Fixed issue where restoring a DB backup would cause backup_local_db task to be stuck running

Slightly updated tasks UI
This commit is contained in:
Isaac Abadi
2022-04-21 19:56:09 -04:00
parent a288163644
commit d2d125743e
3 changed files with 10 additions and 5 deletions

View File

@@ -31,14 +31,18 @@ export class RestoreDbDialogComponent implements OnInit {
}
restoreClicked(): void {
this.restoring = true;
if (this.selected_backup.length !== 1) return;
this.postsService.restoreDBBackup(this.selected_backup[0]).subscribe(res => {
this.restoring = false;
if (res['success']) {
this.postsService.openSnackBar('Database successfully restored!');
this.dialogRef.close();
} else {
this.postsService.openSnackBar('Failed to restore database! See logs for more info.');
}
}, err => {
this.restoring = false;
this.postsService.openSnackBar('Failed to restore database! See browser console for more info.');
console.error(err);
});