restores Helder in all its glory
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Foundation
|
||||
import HelderCore
|
||||
import HelderServices
|
||||
|
||||
/// The machine-wide recent-projects list; never the user's real one.
|
||||
final class FakeRecentProjects: RecentProjectsStoring, @unchecked Sendable {
|
||||
private let state: Locked<[RecentProject]>
|
||||
|
||||
init(_ projects: [RecentProject] = []) {
|
||||
state = Locked(projects)
|
||||
}
|
||||
|
||||
var projects: [RecentProject] { state.current }
|
||||
|
||||
func list() async -> [RecentProject] { state.current }
|
||||
|
||||
func add(_ path: String) async {
|
||||
state.mutate { $0 = RecentLists.pushing(RecentProject(path: path, name: PathUtils.basename(path)), onto: $0) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user