One off fixes

This commit is contained in:
Mo Bitar
2020-02-12 23:22:37 -06:00
parent 2daef55827
commit 7a587a275d
6 changed files with 252 additions and 287 deletions

View File

@@ -50,10 +50,9 @@ class FooterCtrl extends PureCtrl {
onAppLaunch() {
super.onAppLaunch();
this.application.hasPasscode().then((value) => {
this.setState({
hasPasscode: value
});
const hasPasscode = this.application.hasPasscode();
this.setState({
hasPasscode: hasPasscode
});
this.godService.checkForSecurityUpdate().then((available) => {

View File

@@ -63,23 +63,24 @@ class AccountMenuCtrl extends PureCtrl {
async onAppKeyChange() {
super.onAppKeyChange();
this.setState(await this.refreshedCredentialState());
this.setState(this.refreshedCredentialState());
}
async onAppLaunch() {
super.onAppLaunch();
this.setState(await this.refreshedCredentialState());
this.setState(this.refreshedCredentialState());
this.loadHost();
this.checkForSecurityUpdate();
this.reloadAutoLockInterval();
this.loadBackupsAvailability();
}
async refreshedCredentialState() {
refreshedCredentialState() {
return {
user: this.application.getUser(),
canAddPasscode: !this.application.isEphemeralSession(),
hasPasscode: await this.application.hasPasscode()
hasPasscode: this.application.hasPasscode(),
showPasscodeForm: false
};
}
@@ -115,8 +116,8 @@ class AccountMenuCtrl extends PureCtrl {
}
async loadBackupsAvailability() {
const hasUser = !isNullOrUndefined(await this.application.getUser());
const hasPasscode = await this.application.hasPasscode();
const hasUser = !isNullOrUndefined(this.application.getUser());
const hasPasscode = this.application.hasPasscode();
const encryptedAvailable = hasUser || hasPasscode;
function encryptionStatusString() {
@@ -522,10 +523,17 @@ class AccountMenuCtrl extends PureCtrl {
}
});
};
this.godService.presentPrivilegesModal(
ProtectedActions.ManagePasscode,
run
const needsPrivilege = await this.application.privilegesManager.actionRequiresPrivilege(
ProtectedActions.ManagePasscode
);
if (needsPrivilege) {
this.godService.presentPrivilegesModal(
ProtectedActions.ManagePasscode,
run
);
} else {
run();
}
}
isDesktopApplication() {

View File

@@ -5,11 +5,13 @@ import { PureCtrl } from '@Controllers';
class PrivilegesManagementModalCtrl extends PureCtrl {
/* @ngInject */
constructor(
$scope,
$timeout,
$element,
application
application,
appState
) {
super(null, $timeout);
super($scope, $timeout, application, appState);
this.$element = $element;
this.application = application;
}

View File

@@ -281,7 +281,7 @@
.sk-p
| Download a backup of all your data.
.sk-panel-row
form.sk-panel-form.sk-panel-row(ng-if='self.encryptedBackupsAvailable()')
form.sk-panel-form.sk-panel-row(ng-if='self.state.encryptionEnabled')
.sk-input-group
label.sk-horizontal-group.tight
input(

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long