Improves behaviour of dark/light changes on iOS
This commit is contained in:
parent
ee69714b90
commit
b739f6dd61
|
@ -134,7 +134,9 @@ final class AppDefaults: ObservableObject {
|
|||
}
|
||||
set {
|
||||
AppDefaults.store.set(newValue.rawValue, forKey: Key.userInterfaceColorPalette)
|
||||
objectWillChange.send()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
|
||||
self.objectWillChange.send()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ struct MainApp: App {
|
|||
.onAppear { refreshProgress.startup() }
|
||||
.environmentObject(refreshProgress)
|
||||
.environmentObject(defaults)
|
||||
.modifier(PreferredColorSchemeModifier(preferredColorScheme: defaults.userInterfaceColorPalette))
|
||||
.preferredColorScheme(AppDefaults.userInterfaceColorScheme)
|
||||
}
|
||||
.commands {
|
||||
CommandGroup(after: .newItem, addition: {
|
||||
|
|
|
@ -94,7 +94,8 @@ struct SidebarToolbarModifier: ViewModifier {
|
|||
AddFolderView()
|
||||
}
|
||||
if viewModel.sheetToShow == .settings {
|
||||
SettingsView().modifier(PreferredColorSchemeModifier(preferredColorScheme: defaults.userInterfaceColorPalette))
|
||||
SettingsView()
|
||||
.preferredColorScheme(AppDefaults.userInterfaceColorScheme)
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue