From 3f8ff91e2c8d417f8d50e0a64ac57d535f25912a Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sat, 27 Mar 2021 08:30:46 +0100 Subject: [PATCH] handle app crash --- packages/web/src/utility/errorHandler.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/web/src/utility/errorHandler.ts b/packages/web/src/utility/errorHandler.ts index 00f687e5..0919a61b 100644 --- a/packages/web/src/utility/errorHandler.ts +++ b/packages/web/src/utility/errorHandler.ts @@ -18,13 +18,11 @@ window.onunhandledrejection = async e => { console.error('Error clearing app data', err); } 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())); 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(); } };