feat: download backup before changing password

This commit is contained in:
Baptiste Grob
2020-10-01 16:02:30 +02:00
parent 2acff87ffd
commit add0497e14
2 changed files with 7 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ export interface Bridge {
onMajorDataChange(): void; onMajorDataChange(): void;
onInitialDataLoad(): void; onInitialDataLoad(): void;
onSearch(text?: string): void; onSearch(text?: string): void;
downloadBackup(): void;
} }
const KEYCHAIN_STORAGE_KEY = 'keychain'; const KEYCHAIN_STORAGE_KEY = 'keychain';
@@ -45,4 +46,6 @@ export class BrowserBridge implements Bridge {
} }
onSearch() { onSearch() {
} }
downloadBackup() {
}
} }

View File

@@ -44,7 +44,6 @@ type WebServices = {
export class WebApplication extends SNApplication { export class WebApplication extends SNApplication {
private $compile?: ng.ICompileService
private scope?: ng.IScope private scope?: ng.IScope
private webServices!: WebServices private webServices!: WebServices
private currentAuthenticationElement?: JQLite private currentAuthenticationElement?: JQLite
@@ -55,10 +54,10 @@ export class WebApplication extends SNApplication {
constructor( constructor(
deviceInterface: WebDeviceInterface, deviceInterface: WebDeviceInterface,
identifier: string, identifier: string,
$compile: ng.ICompileService, private $compile: ng.ICompileService,
scope: ng.IScope, scope: ng.IScope,
defaultSyncServerHost: string, defaultSyncServerHost: string,
bridge: Bridge, private bridge: Bridge,
) { ) {
super( super(
bridge.environment, bridge.environment,
@@ -90,7 +89,7 @@ export class WebApplication extends SNApplication {
service.application = undefined; service.application = undefined;
} }
this.webServices = {} as WebServices; this.webServices = {} as WebServices;
this.$compile = undefined; (this.$compile as any) = undefined;
this.editorGroup.deinit(); this.editorGroup.deinit();
this.componentGroup.deinit(); this.componentGroup.deinit();
(this.scope! as any).application = undefined; (this.scope! as any).application = undefined;
@@ -156,6 +155,7 @@ export class WebApplication extends SNApplication {
} }
presentPasswordWizard(type: PasswordWizardType) { presentPasswordWizard(type: PasswordWizardType) {
this.bridge.downloadBackup();
const scope = this.scope!.$new(true) as PasswordWizardScope; const scope = this.scope!.$new(true) as PasswordWizardScope;
scope.type = type; scope.type = type;
scope.application = this; scope.application = this;