Observe user preferences and change on demand

This commit is contained in:
Mo Bitar
2019-04-13 11:41:55 -05:00
parent 8bc59b8e24
commit ab1c79fe93
2 changed files with 992 additions and 988 deletions

View File

@@ -24,6 +24,11 @@ class AuthManager extends SFAuthManager {
this.configureUserPrefs();
this.checkForSecurityUpdate();
this.modelManager.addItemSyncObserver("user-prefs", "SN|UserPreferences", (allItems, validItems, deletedItems, source, sourceKey) => {
this.userPreferencesDidChange();
});
}
offline() {
@@ -136,7 +141,6 @@ class AuthManager extends SFAuthManager {
let contentTypePredicate = new SFPredicate("content_type", "=", prefsContentType);
this.singletonManager.registerSingleton([contentTypePredicate], (resolvedSingleton) => {
this.userPreferences = resolvedSingleton;
this.userPreferencesDidChange();
}, (valueCallback) => {
// Safe to create. Create and return object.
var prefs = new SFItem({content_type: prefsContentType});

1974
package-lock.json generated

File diff suppressed because it is too large Load Diff