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() { onAppLaunch() {
super.onAppLaunch(); super.onAppLaunch();
this.application.hasPasscode().then((value) => { const hasPasscode = this.application.hasPasscode();
this.setState({ this.setState({
hasPasscode: value hasPasscode: hasPasscode
});
}); });
this.godService.checkForSecurityUpdate().then((available) => { this.godService.checkForSecurityUpdate().then((available) => {

View File

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

View File

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

View File

@@ -281,7 +281,7 @@
.sk-p .sk-p
| Download a backup of all your data. | Download a backup of all your data.
.sk-panel-row .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 .sk-input-group
label.sk-horizontal-group.tight label.sk-horizontal-group.tight
input( input(

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long