From 5d1063e9358b7c4a1a49befa7d786f8e2c20eb38 Mon Sep 17 00:00:00 2001 From: b1rdhous3 Date: Sun, 5 Apr 2020 20:05:02 +0200 Subject: [PATCH] Check if requested Instance is running (#759) Preventing a dead lock when the requested instance from local store is not running. If it is not running we will now delete the lastSelectedInstance and switch back to index 0. --- assets/webconfig/js/ui_utils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index 27600ecc..6d2e74c7 100644 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -107,8 +107,12 @@ function loadContent(event, forceRefresh) var tag; var lastSelectedInstance = getStorage('lastSelectedInstance', false); - if(lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance)) - instanceSwitch(lastSelectedInstance); + + if (lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance)) + if (typeof(window.serverInfo.instance[lastSelectedInstance].running) !== 'undefined' && window.serverInfo.instance[lastSelectedInstance].running) + instanceSwitch(lastSelectedInstance); + else + removeStorage('lastSelectedInstance', false); if(typeof event != "undefined") {