Reset UI when all backups deleted
This commit is contained in:
parent
b2fa05060d
commit
2cdab82bfd
|
@ -206,14 +206,11 @@ async function initEvents() {
|
|||
}
|
||||
|
||||
function reset() {
|
||||
//real body shown
|
||||
//minibar hidden
|
||||
//initial stuff shown
|
||||
showApplication(true);
|
||||
showNotLoadedControls();
|
||||
hideErrors();
|
||||
removeChildren(ui.chatDisplay);
|
||||
history.replaceState(null, 'MSN Viewer', '');
|
||||
history.pushState(null, 'MSN Viewer', '/');
|
||||
document.title = 'MSN Viewer';
|
||||
}
|
||||
|
||||
|
@ -221,6 +218,7 @@ async function deleteBackup(e: MouseEvent) {
|
|||
const el = e.currentTarget as HTMLElement;
|
||||
const anchor = el.closest('a.backup-entry') as HTMLAnchorElement | null;
|
||||
const filename = anchor?.dataset['filename'];
|
||||
|
||||
if (filename) {
|
||||
if (window.confirm('Do you want to remove ' + filename + ' from the backup list?')) {
|
||||
try {
|
||||
|
@ -231,6 +229,7 @@ async function deleteBackup(e: MouseEvent) {
|
|||
populateSavedBackups();
|
||||
} else {
|
||||
toggleLoadPrevious(false);
|
||||
reset();
|
||||
}
|
||||
} catch (e) {
|
||||
displayNonFatalError('Could not remove backup', e as Error);
|
||||
|
|
Loading…
Reference in New Issue