Skip to content

Commit 49dafee

Browse files
committed
fix: prevent light-mode flash on launch when dark appearance is set
1 parent d4f2025 commit 49dafee

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

TablePro/AppDelegate.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6666
}
6767

6868
func applicationDidFinishLaunching(_ notification: Notification) {
69+
// Re-apply appearance now that NSApp exists.
70+
// AppSettingsManager.shared may already be initialized (by @State in TableProApp),
71+
// but NSApp was nil at that point so NSApp?.appearance was a no-op.
72+
let appearanceSettings = AppSettingsManager.shared.appearance
73+
ThemeEngine.shared.updateAppearanceAndTheme(
74+
mode: appearanceSettings.appearanceMode,
75+
lightThemeId: appearanceSettings.preferredLightThemeId,
76+
darkThemeId: appearanceSettings.preferredDarkThemeId
77+
)
78+
6979
NSWindow.allowsAutomaticWindowTabbing = true
7080
let syncSettings = AppSettingsStorage.shared.loadSync()
7181
let passwordSyncExpected = syncSettings.enabled && syncSettings.syncConnections && syncSettings.syncPasswords

0 commit comments

Comments
 (0)