diff --git a/more/more.html b/more/more.html index 36455d6..4a13b1d 100644 --- a/more/more.html +++ b/more/more.html @@ -56,15 +56,14 @@ EventBridge.emitWebEvent(JSON.stringify(readyEvent)); } - var currentlyRunningScripts = {}; + EventBridge.scriptEventReceived.connect(function(message){ - currentlyRunningScripts = JSON.parse(message); - + //update the buttons buttonList.forEach(function(item){ var btn = ""; - if(CheckRunning(item.url) != false){ + if(message.indexOf(item.url) != -1){ //Means already running btn = ""; }else{ @@ -107,15 +106,7 @@ } - function CheckRunning(scriptUrl){ - alert("checkrunning!"); - if(currentlyRunningScripts.some(currentlyRunningScripts => currentlyRunningScripts.path === scriptUrl)){ - return true; - } else{ - return false; - } - } - +