From 1f67adc6dd5f4c960aec8e674860fe4f747af394 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Thu, 12 Mar 2020 03:46:09 -0400 Subject: [PATCH] Fix menu unsubscribing. --- .../communityScripts/decentralizedGoTo/decentralizedGoTo.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/communityScripts/decentralizedGoTo/decentralizedGoTo.js b/scripts/communityScripts/decentralizedGoTo/decentralizedGoTo.js index 43dba59142..2b451e123c 100644 --- a/scripts/communityScripts/decentralizedGoTo/decentralizedGoTo.js +++ b/scripts/communityScripts/decentralizedGoTo/decentralizedGoTo.js @@ -109,6 +109,8 @@ } function onMenuItemEvent(menuItem) { + var menuItemList = JSON.stringify(Settings.getValue("goToDecentral", "")); + var menuItemExists = menuItemList.indexOf(menuItem) !== -1; if (menuItem == "Subscribe to new GoTo provider") { goToAddress = Settings.getValue("goToDecentral", ""); var arrayLength = goToAddress.length; @@ -116,9 +118,9 @@ if (prom) { goToAddress[arrayLength] = prom; Settings.setValue("goToDecentral", goToAddress); - Menu.addMenuItem("GoTo > Unsubscribe from GoTo provider", prom); + Menu.addMenuItem("Explore > Unsubscribe from GoTo provider", prom); } - } else { + } else if (menuItemExists) { goToAddresses = Settings.getValue("goToDecentral", ""); Menu.removeMenuItem("Explore > Unsubscribe from GoTo provider", menuItem); goToAddresses.remove(menuItem);