diff --git a/web/projects/ui/src/app/components/backup-drives/backup.service.ts b/web/projects/ui/src/app/components/backup-drives/backup.service.ts index cc1898e7e..7e05178bf 100644 --- a/web/projects/ui/src/app/components/backup-drives/backup.service.ts +++ b/web/projects/ui/src/app/components/backup-drives/backup.service.ts @@ -61,7 +61,7 @@ export class BackupService { ) } - async hasThisBackup(target: BackupTarget, id: string): Promise { + hasThisBackup(target: BackupTarget, id: string): boolean { return ( target.startOs[id] && this.emver.compare(target.startOs[id].version, '0.3.6') !== -1 diff --git a/web/projects/ui/src/app/modals/backup-server-select/backup-server-select.page.ts b/web/projects/ui/src/app/modals/backup-server-select/backup-server-select.page.ts index e1f4f8961..0f1c47276 100644 --- a/web/projects/ui/src/app/modals/backup-server-select/backup-server-select.page.ts +++ b/web/projects/ui/src/app/modals/backup-server-select/backup-server-select.page.ts @@ -49,6 +49,7 @@ export class BackupServerSelectModal { if (role === 'confirm') { try { + // @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf argon2.verify(server.passwordHash!, data) await this.restoreFromBackup(serverId, data) } catch (e: any) { diff --git a/web/projects/ui/src/app/pages/server-routes/server-backup/server-backup.page.ts b/web/projects/ui/src/app/pages/server-routes/server-backup/server-backup.page.ts index b570b1603..25532c256 100644 --- a/web/projects/ui/src/app/pages/server-routes/server-backup/server-backup.page.ts +++ b/web/projects/ui/src/app/pages/server-routes/server-backup/server-backup.page.ts @@ -60,7 +60,7 @@ export class ServerBackupPage { component: BackupSelectPage, }) - modal.onWillDismiss().then(res => { + modal.onDidDismiss().then(res => { if (res.data) { this.serviceIds = res.data this.presentModalPassword(target) @@ -90,6 +90,7 @@ export class ServerBackupPage { .subscribe(async (password: string) => { const { passwordHash, id } = await getServerInfo(this.patch) + // @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf // confirm password matches current master password argon2.verify(passwordHash, password) @@ -103,7 +104,7 @@ export class ServerBackupPage { } catch { setTimeout( () => this.presentModalOldPassword(target, password), - 500, + 250, ) return } @@ -134,8 +135,8 @@ export class ServerBackupPage { }) .pipe(take(1)) .subscribe(async (oldPassword: string) => { - const passwordHash = target.entry.startOs[id].passwordHash! - argon2.verify(passwordHash, oldPassword) + // @TODO Alex if invalid password, we should tell the user "Invalid password" and halt execution of this function. The modal should remain so the user can try again. Correct password is asdfasdf + argon2.verify(target.entry.startOs[id].passwordHash!, oldPassword) await this.createBackup(target, password, oldPassword) }) }