diff --git a/more/app-more.js b/more/app-more.js index 6c9be3c..4ba0f69 100644 --- a/more/app-more.js +++ b/more/app-more.js @@ -54,7 +54,16 @@ function sendRunningScriptList() { var currentlyRunningScripts = ScriptDiscoveryService.getRunning(); - tablet.emitScriptEvent(JSON.stringify(currentlyRunningScripts)); + var newMessage = "RSL4MOREAPP:"; + var runningScriptJson; + for (var j = 0; j < currentlyRunningScripts.length; j++) { + runningScriptJson = currentlyRunningScripts[j].url; + if (runningScriptJson.indexOf("https://kasenvr.github.io/community-apps/applications") !== -1) { + newMessage = newMessage + "_" + runningScriptJson; + } + } + + tablet.emitScriptEvent(newMessage); } function onMoreAppWebEventReceived(eventz) { @@ -77,7 +86,7 @@ Script.setTimeout(function() { sendRunningScriptList(); - }, 2000); + }, 1500); } } @@ -93,7 +102,7 @@ Script.setTimeout(function() { sendRunningScriptList(); - }, 2000); + }, 1500); } } @@ -107,7 +116,7 @@ function onScreenChanged(type, url) { - if (type === "Web" && url.indexOf(APP_URL) !== -1) { + if (type === "Web" && url.indexOf(APP_URL) != -1) { //Active //print("MORE... ACTIVE"); Appstatus = true; diff --git a/more/more.html b/more/more.html index 1014e74..e6f60c9 100644 --- a/more/more.html +++ b/more/more.html @@ -92,18 +92,20 @@ EventBridge.scriptEventReceived.connect(function(message){ //update the buttons - buttonList.forEach(function(item){ - var btn = ""; - if (message.indexOf(item.url) !== -1) { - //Means already running - btn = ""; - } else { - //Means not already installed - btn = ""; - } - - document.getElementById(item.id).innerHTML = btn; - }); + if (message.indexOf("RSL4MOREAPP:") !== -1){ + buttonList.forEach(function(item){ + var btn = ""; + if (message.indexOf(item.url) !== -1) { + //Means already running + btn = ""; + } else { + //Means not already installed + btn = ""; + } + + document.getElementById(item.id).innerHTML = btn; + }); + } }); function install(script, btnId){ @@ -143,7 +145,7 @@