fix: reload user preferences after signing in

This commit is contained in:
Baptiste Grob
2020-10-27 14:15:13 +01:00
parent 19243082e2
commit 3330b201dd

View File

@@ -58,15 +58,15 @@ export class PreferencesManager extends ApplicationService {
this.userPreferences = (await this.application!.singletonManager!.findOrCreateSingleton( this.userPreferences = (await this.application!.singletonManager!.findOrCreateSingleton(
predicate, predicate,
contentType, contentType,
FillItemContent({}), FillItemContent({})
)) as SNUserPrefs; )) as SNUserPrefs;
this.loadingPrefs = false; this.loadingPrefs = false;
this.needsSingletonReload = false; this.needsSingletonReload = false;
const didChange = if (
!previousRef || previousRef?.uuid !== this.userPreferences.uuid ||
this.userPreferences.lastSyncBegan?.getTime() !== this.userPreferences.lastSyncBegan?.getTime() !==
previousRef?.lastSyncBegan?.getTime(); previousRef?.lastSyncBegan?.getTime()
if (didChange) { ) {
this.webApplication this.webApplication
.getAppState() .getAppState()
.setUserPreferences(this.userPreferences); .setUserPreferences(this.userPreferences);