Skip to content

Commit

Permalink
feat: download backup before changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Oct 1, 2020
1 parent 2acff87 commit add0497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/services/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface Bridge {
onMajorDataChange(): void;
onInitialDataLoad(): void;
onSearch(text?: string): void;
downloadBackup(): void;
}

const KEYCHAIN_STORAGE_KEY = 'keychain';
Expand Down Expand Up @@ -45,4 +46,6 @@ export class BrowserBridge implements Bridge {
}
onSearch() {
}
downloadBackup() {
}
}
8 changes: 4 additions & 4 deletions app/assets/javascripts/ui_models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type WebServices = {

export class WebApplication extends SNApplication {

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

presentPasswordWizard(type: PasswordWizardType) {
this.bridge.downloadBackup();
const scope = this.scope!.$new(true) as PasswordWizardScope;
scope.type = type;
scope.application = this;
Expand Down

0 comments on commit add0497

Please sign in to comment.