handle app crash

This commit is contained in:
Jan Prochazka 2021-03-27 08:30:46 +01:00
parent 11436c065c
commit 3f8ff91e2c

View File

@ -18,13 +18,11 @@ window.onunhandledrejection = async e => {
console.error('Error clearing app data', err); console.error('Error clearing app data', err);
} }
window.location.reload(); window.location.reload();
} else { }
} else {
if (window.confirm('Sorry, DbGate has crashed.\nPress OK for reload application')) {
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime())); localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
window.location.reload(); window.location.reload();
} }
} else {
window.alert('Sorry, DbGate has crashed.\nAfter OK DbGate will be reloaded');
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
window.location.reload();
} }
}; };