From a76c3f028d4bff2fd8ce1c0381de7d32169943dc Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 24 Sep 2018 14:46:00 -0700 Subject: [PATCH] Small bugfixes --- scripts/modules/appUi.js | 3 ++- scripts/system/commerce/wallet.js | 4 +--- scripts/system/marketplaces/marketplaces.js | 11 +++++------ scripts/system/tablet-goto.js | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/modules/appUi.js b/scripts/modules/appUi.js index 78e9ed38f0..db395ea778 100644 --- a/scripts/modules/appUi.js +++ b/scripts/modules/appUi.js @@ -107,7 +107,7 @@ function AppUi(properties) { that.notificationPollCaresAboutSince = false; that.notificationInitialCallbackMade = false; that.notificationDisplayBanner = function (message) { - if (that.isOpen) { + if (!that.isOpen) { Window.displayAnnouncement(message); } }; @@ -120,6 +120,7 @@ function AppUi(properties) { // Set isOpen, wireEventBridge, set buttonActive as appropriate, // and finally call onOpened() or onClosed() IFF defined. that.setCurrentVisibleScreenMetadata(type, url); + if (that.checkIsOpen(type, url)) { that.wireEventBridge(true); if (!that.isOpen) { diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 1fce45bb6f..639c8aa0b3 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -576,9 +576,7 @@ function isReturnedDataEmpty(data) { return historyArray.length === 0; } -// -// Manage the connection between the button and the window. -// + var BUTTON_NAME = "WALLET"; var WALLET_QML_SOURCE = "hifi/commerce/wallet/Wallet.qml"; var ui; diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index 3a239aa774..27fa929390 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -1040,15 +1040,16 @@ function notificationPollCallback(updatesArray) { if (updatesArray.length > 0) { var message; if (!ui.notificationInitialCallbackMade) { - message = updatesArray.length + " of your purchased items have updates available. " + - "Open MARKET to update."; + message = updatesArray.length + " of your purchased items " + + (updatesArray.length === 1 ? "has an update " : "have updates ") + + "available. Open MARKET to update."; ui.notificationDisplayBanner(message); ui.notificationPollCaresAboutSince = true; } else { for (var i = 0; i < updatesArray.length; i++) { message = "Update available for \"" + - updatesArray[i].marketplace_item_name + "\"." + + updatesArray[i].base_item_title + "\"." + "Open MARKET to update."; ui.notificationDisplayBanner(message); } @@ -1061,9 +1062,7 @@ function isReturnedDataEmpty(data) { return historyArray.length === 0; } -// -// Manage the connection between the button and the window. -// + var BUTTON_NAME = "MARKET"; var MARKETPLACE_URL = METAVERSE_SERVER_URL + "/marketplace"; var MARKETPLACE_URL_INITIAL = MARKETPLACE_URL + "?"; // Append "?" to signal injected script that it's the initial page. diff --git a/scripts/system/tablet-goto.js b/scripts/system/tablet-goto.js index 22a9752db8..0f032ae74d 100644 --- a/scripts/system/tablet-goto.js +++ b/scripts/system/tablet-goto.js @@ -91,7 +91,7 @@ function notificationPollCallback(userStoriesArray) { ui.messagesWaiting(shouldShowDot && !ui.isOpen); if (totalStories > 0 && !ui.isOpen && !ui.notificationInitialCallbackMade) { - message = "There " + (totalStories === 1 ? "is " : "are ") + totalStories + "event" + + message = "There " + (totalStories === 1 ? "is " : "are ") + totalStories + " event" + (totalStories === 1 ? "" : "s") + " to know about. " + "Open GOTO to see " + (totalStories === 1 ? "it" : "them") + "."; ui.notificationDisplayBanner(message);