Protocol upgrading WIP

This commit is contained in:
Mo Bitar
2020-03-15 18:29:01 -05:00
parent 5a6a41933a
commit 148e840757
15 changed files with 956 additions and 403 deletions

View File

@@ -38,9 +38,7 @@ class FooterCtrl extends PureCtrl {
this.rooms = [];
this.themesWithIcons = [];
this.showSyncResolution = false;
this.addRootScopeListeners();
this.statusManager.addStatusObserver((string) => {
this.$timeout(() => {
this.arbitraryStatusMessage = string;
@@ -48,6 +46,14 @@ class FooterCtrl extends PureCtrl {
});
}
reloadUpgradeStatus() {
this.godService.checkForSecurityUpdate().then((available) => {
this.setState({
dataUpgradeAvailable: available
});
});
}
onAppLaunch() {
super.onAppLaunch();
const hasPasscode = this.application.hasPasscode();
@@ -55,9 +61,7 @@ class FooterCtrl extends PureCtrl {
hasPasscode: hasPasscode
});
this.godService.checkForSecurityUpdate().then((available) => {
this.securityUpdateAvailable = available;
});
this.reloadUpgradeStatus();
this.user = this.application.getUser();
this.updateOfflineStatus();
this.findErrors();
@@ -66,9 +70,6 @@ class FooterCtrl extends PureCtrl {
}
addRootScopeListeners() {
this.$rootScope.$on("security-update-status-changed", () => {
this.securityUpdateAvailable = this.godService.securityUpdateAvailable;
});
this.$rootScope.$on("reload-ext-data", () => {
this.reloadExtendedData();
});
@@ -110,7 +111,9 @@ class FooterCtrl extends PureCtrl {
/** @override */
onAppEvent(eventName) {
if (eventName === ApplicationEvents.EnteredOutOfSync) {
if (eventName === ApplicationEvents.KeyStatusChanged) {
this.reloadUpgradeStatus();
} else if (eventName === ApplicationEvents.EnteredOutOfSync) {
this.setState({
outOfSync: true
});
@@ -220,7 +223,7 @@ class FooterCtrl extends PureCtrl {
}
openSecurityUpdate() {
this.godService.presentPasswordWizard('upgrade-security');
this.godService.performProtocolUpgrade();
}
findErrors() {