This commit is contained in:
Max Goedjen
2022-01-02 16:07:33 -08:00
parent d365da11cd
commit 64225af0c1
4 changed files with 45 additions and 52 deletions

View File

@@ -18,6 +18,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}()
private let updater = Updater(checkOnLaunch: false)
private let notifier = Notifier()
private let publicKeyFileStoreController = PublicKeyFileStoreController()
private lazy var agent: Agent = {
Agent(storeList: storeList, witness: notifier)
}()
@@ -25,10 +26,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let path = (NSHomeDirectory() as NSString).appendingPathComponent("socket.ssh") as String
return SocketController(path: path)
}()
// TODO: CLEANUP
private lazy var fakeFile: PublicKeyStandinFileStoreController = {
PublicKeyStandinFileStoreController(secrets: storeList.stores.flatMap({ $0.secrets }))
}()
private var updateSink: AnyCancellable?
func applicationDidFinishLaunching(_ aNotification: Notification) {
@@ -41,12 +38,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
guard let update = update else { return }
self.notifier.notify(update: update, ignore: self.updater.ignore(release:))
}
// TODO: CLEANUP
DispatchQueue.main.async {
print(self.fakeFile)
}
}
func reloadKeys() {
// TODO: This
// storeList.reloadAll()
try? publicKeyFileStoreController.clear()
try? publicKeyFileStoreController.generatePublicKeys(for: storeList.stores.flatMap({ $0.secrets }))
}
}