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.
This commit is contained in:
b1rdhous3
2020-04-05 20:05:02 +02:00
committed by GitHub
parent 7773d07571
commit 5d1063e935

View File

@@ -107,8 +107,12 @@ function loadContent(event, forceRefresh)
var tag;
var lastSelectedInstance = getStorage('lastSelectedInstance', false);
if(lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance))
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")
{