Skip to content

Commit

Permalink
Refresh on Defaults change notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaylee committed Jun 9, 2023
1 parent 2cc2b3a commit de5d7f9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/App/MenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ class MenuController: NSObject {
}
)

NotificationCenter.default.addObserver(
forName: Defaults.changedNotification,
object: Defaults.shared,
queue: nil,
using: { [weak self] _ in
self?.refreshMenuContents()
}
)

// Update UI now
refreshMenuContents()
}
Expand Down

0 comments on commit de5d7f9

Please sign in to comment.