From 1909c62a69c8c976e0448e1bd23dea626b00e813 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 13 Mar 2020 13:32:39 -0400 Subject: [PATCH] Bugfixing. - authored by Keb Hellion. --- more/app-more.js | 17 +++++++++++++---- more/more.html | 41 ++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 23 deletions(-) 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 @@

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 @@

-
- +
+ +