mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-14 06:26:41 +03:00
30 lines
884 B
Swift
30 lines
884 B
Swift
// Copyright © 2021 Encrypted Ink. All rights reserved.
|
|
|
|
import Cocoa
|
|
|
|
@NSApplicationMain
|
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
|
|
|
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
|
return false
|
|
}
|
|
|
|
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
|
Agent.shared.start()
|
|
Agent.shared.setupStatusBarItem()
|
|
}
|
|
|
|
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
|
Agent.shared.reopen()
|
|
return true
|
|
}
|
|
|
|
func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool {
|
|
if let url = userActivity.webpageURL?.absoluteString {
|
|
print(url)
|
|
}
|
|
return true
|
|
}
|
|
|
|
}
|