From ec7021b436e9a81f6925f8b77166eb37a1204c1c Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 18 Sep 2020 23:22:28 +0200 Subject: [PATCH] added debugModeEnabled option --- src/public/app/services/ws.js | 8 ++++++-- src/services/options_init.js | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/ws.js b/src/public/app/services/ws.js index 4f8e47b96..502b8596c 100644 --- a/src/public/app/services/ws.js +++ b/src/public/app/services/ws.js @@ -155,10 +155,14 @@ async function consumeSyncData() { catch (e) { logError(`Encountered error ${e.message}: ${e.stack}, reloading frontend.`); - // if there's an error in updating the frontend then the easy option to recover is to reload the frontend completely - if (!glob.isDev) { + if (!glob.isDev && !options.is('debugModeEnabled')) { + // if there's an error in updating the frontend then the easy option to recover is to reload the frontend completely + utils.reloadApp(); } + else { + alert("Encountered error, check out the console."); + } } for (const syncRow of nonProcessedSyncRows) { diff --git a/src/services/options_init.js b/src/services/options_init.js index 4fe655a18..26283a424 100644 --- a/src/services/options_init.js +++ b/src/services/options_init.js @@ -87,7 +87,8 @@ const defaultOptions = [ { name: 'hideIncludedImages_main', value: 'true', isSynced: false }, { name: 'attributeListExpanded', value: 'false', isSynced: false }, { name: 'promotedAttributesExpanded', value: 'true', isSynced: true }, - { name: 'similarNotesExpanded', value: 'true', isSynced: true } + { name: 'similarNotesExpanded', value: 'true', isSynced: true }, + { name: 'debugModeEnabled', value: 'false', isSynced: false } ]; function initStartupOptions() {