Skip to content

Commit

Permalink
fix: duplicate entries for active workspace (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
levibostian authored Jan 19, 2022
1 parent 8716b33 commit c903e4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/Tracking/Store/ActiveWorkspaces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ internal protocol ActiveWorkspacesManager: AutoMockable {
// sourcery: InjectRegister = "ActiveWorkspacesManager"
// sourcery: InjectSingleton
internal class InMemoryActiveWorkspaces: ActiveWorkspacesManager {
private(set) var activeWorkspaces: [SiteId] = []
private var activeWorkspacesSet: Set<SiteId> = Set()

var activeWorkspaces: [SiteId] {
Array(activeWorkspacesSet)
}

func addWorkspace(siteId: SiteId) {
activeWorkspaces.append(siteId)
activeWorkspacesSet.insert(siteId)
}

// Convenient method to get instance. This object is meant to be shared by all workspaces running
Expand Down

0 comments on commit c903e4a

Please sign in to comment.