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

@@ -2,6 +2,7 @@ import { isDesktopApplication, isNullOrUndefined } from '@/utils';
import template from '%/directives/account-menu.pug';
import { ProtectedActions } from 'snjs';
import { PureCtrl } from '@Controllers';
import { AppStateEvents } from '@/state';
import {
STRING_ACCOUNT_MENU_UNCHECK_MERGE,
STRING_SIGN_OUT_CONFIRMATION,
@@ -32,25 +33,25 @@ class AccountMenuCtrl extends PureCtrl {
$scope,
$rootScope,
$timeout,
archiveManager,
appVersion,
application,
appState,
archiveManager,
godService,
lockManager,
application
) {
super($timeout);
this.$scope = $scope;
this.$rootScope = $rootScope;
this.$timeout = $timeout;
this.appState = appState;
this.application = application;
this.archiveManager = archiveManager;
this.godService = godService;
this.lockManager = lockManager;
this.application = application;
this.state = {
appVersion: 'v' + (window.electronAppVersion || appVersion),
user: this.application.getUser(),
canAddPasscode: !this.application.isEphemeralSession(),
passcodeAutoLockOptions: this.lockManager.getAutoLockIntervalOptions(),
formData: {
mergeLocal: true,
@@ -58,12 +59,17 @@ class AccountMenuCtrl extends PureCtrl {
},
mutable: {}
};
application.onReady(() => {
this.setState({
user: this.application.getUser(),
canAddPasscode: !this.application.isEphemeralSession(),
});
this.loadHost();
this.checkForSecurityUpdate();
this.reloadAutoLockInterval();
this.loadBackupsAvailability();
});
this.syncStatus = this.application.getSyncStatus();
this.loadHost();
this.checkForSecurityUpdate();
this.reloadAutoLockInterval();
this.loadBackupsAvailability();
}
$onInit() {

View File

@@ -11,9 +11,11 @@ class PrivilegesManagementModalCtrl {
this.$element = $element;
this.$timeout = $timeout;
this.application = application;
this.hasPasscode = application.hasPasscode();
this.hasAccount = !application.noUser();
this.reloadPrivileges();
application.onReady(() => {
this.hasPasscode = application.hasPasscode();
this.hasAccount = !application.noAccount();
this.reloadPrivileges();
});
}
displayInfoForCredential(credential) {