Skip to content

Commit

Permalink
Fix missing system icons in sidebar
Browse files Browse the repository at this point in the history
The main window was restored before the system plugins were loaded because it received the ‘libraryDidLoad’ notification earlier.
Regression from 62092eb
  • Loading branch information
J-rg committed Jul 12, 2022
1 parent 1d7bd0f commit 3dd3440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenEmu/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class AppDelegate: NSObject {
assert(OELibraryDatabase.default != nil, "No database available!")

DispatchQueue.main.async {
self.libraryDatabaseDidLoad()
NotificationCenter.default.post(name: .libraryDidLoad, object: OELibraryDatabase.default!)
}

Expand Down Expand Up @@ -793,7 +794,6 @@ extension AppDelegate: NSMenuDelegate {

let notificationCenter = NotificationCenter.default

notificationCenter.addObserver(self, selector: #selector(libraryDatabaseDidLoad), name: .libraryDidLoad, object: nil)
notificationCenter.addObserver(self, selector: #selector(openPreferencePane), name: PreferencesWindowController.openPaneNotificationName, object: nil)

notificationCenter.addObserver(self, selector: #selector(didRepairBindings), name: .OEBindingsRepaired, object: nil)
Expand Down Expand Up @@ -822,7 +822,7 @@ extension AppDelegate: NSMenuDelegate {
}
}

func libraryDatabaseDidLoad(notification: Notification) {
func libraryDatabaseDidLoad() {

libraryLoaded = true

Expand Down

0 comments on commit 3dd3440

Please sign in to comment.