Skip to content

Commit 2294e99

Browse files
committed
Remove unneeded singleton since SBApplication is supposed to own it
1 parent 235c9e3 commit 2294e99

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

Submariner/SBAppDelegate.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ fileprivate let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, catego
1414
@main
1515
@objc(SBAppDelegate) class SBAppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate, NSUserInterfaceValidations {
1616

17-
// #MARK: - Singleton
18-
19-
private static var _sharedInstance = SBAppDelegate()
20-
21-
// FIXME: Make var
22-
@objc static func sharedInstance() -> SBAppDelegate {
23-
return _sharedInstance
24-
}
25-
2617
// #MARK: - Initialization
2718

2819
let databaseController: SBDatabaseController

Submariner/SBPlayer.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,10 @@ extension NSNotification.Name {
411411
// Default, so not one of the buttons (if we have them or not)
412412
if response.actionIdentifier == UNNotificationDefaultActionIdentifier {
413413
DispatchQueue.main.async {
414-
SBAppDelegate.sharedInstance().zoomDatabaseWindow(self)
415-
SBAppDelegate.sharedInstance().goToCurrentTrack(self)
414+
if let appDelegate = NSApp.delegate as? SBAppDelegate {
415+
appDelegate.zoomDatabaseWindow(self)
416+
appDelegate.goToCurrentTrack(self)
417+
}
416418
}
417419
} else if response.actionIdentifier == "SubmarinerSkipAction" {
418420
self.next()

0 commit comments

Comments
 (0)