From f70a9ec4c0864767dfa4a6286920103229c80ee9 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 13 Mar 2020 13:34:32 -0400 Subject: [PATCH] Bugfixing. - authored by Keb Hellion. --- scripts/system/more/app-more.js | 15 +++++++++--- scripts/system/more/more.html | 41 ++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/scripts/system/more/app-more.js b/scripts/system/more/app-more.js index 8224051854..d38befd501 100644 --- a/scripts/system/more/app-more.js +++ b/scripts/system/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); } } diff --git a/scripts/system/more/more.html b/scripts/system/more/more.html index c0cd9aca74..3bd77299ca 100644 --- a/scripts/system/more/more.html +++ b/scripts/system/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 @@

Add more functionalities...

-

Want to add your own app? Read the guide!

+

Want to add your own app? Read the guide!

@@ -167,25 +169,26 @@

-
- +
+ +