Functioning UI

This commit is contained in:
Mo Bitar
2020-02-08 18:57:02 -06:00
parent f6ef4a39e2
commit 8822580e7a
23 changed files with 2088 additions and 1729 deletions

View File

@@ -37,21 +37,29 @@ class FooterCtrl {
this.showSyncResolution = false;
this.addAppStateObserver();
this.updateOfflineStatus();
this.addAppEventObserver();
this.findErrors();
this.streamItems();
this.registerComponentHandler();
this.addRootScopeListeners();
this.godService.checkForSecurityUpdate().then((available) => {
this.securityUpdateAvailable = available;
});
this.statusManager.addStatusObserver((string) => {
this.$timeout(() => {
this.arbitraryStatusMessage = string;
});
});
application.onReady(() => {
this.application.hasPasscode().then((value) => {
this.hasPasscode = value;
});
this.godService.checkForSecurityUpdate().then((available) => {
this.securityUpdateAvailable = available;
});
this.user = this.application.getUser();
this.updateOfflineStatus();
this.addAppEventObserver();
this.findErrors();
this.streamItems();
this.registerComponentHandler();
});
}
addRootScopeListeners() {
@@ -99,7 +107,7 @@ class FooterCtrl {
}
addAppEventObserver() {
this.application.addEventHandler((eventName) => {
this.application.addEventObserver((eventName) => {
if (eventName === ApplicationEvents.LoadedLocalData) {
if(this.offline && this.application.getNoteCount() === 0) {
this.showAccountMenu = true;
@@ -203,12 +211,8 @@ class FooterCtrl {
}, 2000);
}
getUser() {
return this.application.getUser();
}
updateOfflineStatus() {
this.offline = this.application.noUser();
this.offline = this.application.noAccount();
}
openSecurityUpdate() {
@@ -232,10 +236,6 @@ class FooterCtrl {
this.showAccountMenu = false;
}
hasPasscode() {
return this.application.hasPasscode();
}
lockApp() {
this.$rootScope.lockApplication();
}
@@ -351,7 +351,7 @@ class FooterCtrl {
}
clickOutsideAccountMenu() {
if(this.application.privilegesManager.authenticationInProgress()) {
if(this.godService.authenticationInProgress()) {
return;
}
this.showAccountMenu = false;