Ensure to publish object changes on the main thread
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -32,7 +32,9 @@ func setting_get_property_value<T>(key: String, scoped_key: String, default_valu
|
||||
func setting_set_property_value<T: Equatable>(scoped_key: String, old_value: T, new_value: T) -> T? {
|
||||
guard old_value != new_value else { return nil }
|
||||
DamusUserDefaults.standard.set(new_value, forKey: scoped_key)
|
||||
UserSettingsStore.shared?.objectWillChange.send()
|
||||
DispatchQueue.main.async {
|
||||
UserSettingsStore.shared?.objectWillChange.send()
|
||||
}
|
||||
return new_value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user