Fixes user prefs sync race condition

This commit is contained in:
Mo Bitar
2020-04-16 10:17:19 -05:00
parent c94742d248
commit 4451832c9e
5 changed files with 211 additions and 145 deletions

View File

@@ -60,8 +60,8 @@ export class PreferencesManager extends ApplicationService {
return (value !== undefined && value !== null) ? value : defaultValue;
}
setUserPrefValue(key: WebPrefKey, value: any, sync = false) {
this.application!.changeItem(
async setUserPrefValue(key: WebPrefKey, value: any, sync = false) {
await this.application!.changeItem(
this.userPreferences.uuid,
(m) => {
const mutator = m as UserPrefsMutator;