Skip to content

Commit

Permalink
Remove unneeded singleton since SBApplication is supposed to own it
Browse files Browse the repository at this point in the history
  • Loading branch information
NattyNarwhal committed Apr 11, 2024
1 parent 235c9e3 commit 2294e99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 0 additions & 9 deletions Submariner/SBAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ fileprivate let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, catego
@main
@objc(SBAppDelegate) class SBAppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate, NSUserInterfaceValidations {

// #MARK: - Singleton

private static var _sharedInstance = SBAppDelegate()

// FIXME: Make var
@objc static func sharedInstance() -> SBAppDelegate {
return _sharedInstance
}

// #MARK: - Initialization

let databaseController: SBDatabaseController
Expand Down
6 changes: 4 additions & 2 deletions Submariner/SBPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ extension NSNotification.Name {
// Default, so not one of the buttons (if we have them or not)
if response.actionIdentifier == UNNotificationDefaultActionIdentifier {
DispatchQueue.main.async {
SBAppDelegate.sharedInstance().zoomDatabaseWindow(self)
SBAppDelegate.sharedInstance().goToCurrentTrack(self)
if let appDelegate = NSApp.delegate as? SBAppDelegate {
appDelegate.zoomDatabaseWindow(self)
appDelegate.goToCurrentTrack(self)
}
}
} else if response.actionIdentifier == "SubmarinerSkipAction" {
self.next()
Expand Down

0 comments on commit 2294e99

Please sign in to comment.