Small bugfixes

This commit is contained in:
Zach Fox 2018-09-24 14:46:00 -07:00
parent 57c303440b
commit a76c3f028d
4 changed files with 9 additions and 11 deletions

View file

@ -107,7 +107,7 @@ function AppUi(properties) {
that.notificationPollCaresAboutSince = false; that.notificationPollCaresAboutSince = false;
that.notificationInitialCallbackMade = false; that.notificationInitialCallbackMade = false;
that.notificationDisplayBanner = function (message) { that.notificationDisplayBanner = function (message) {
if (that.isOpen) { if (!that.isOpen) {
Window.displayAnnouncement(message); Window.displayAnnouncement(message);
} }
}; };
@ -120,6 +120,7 @@ function AppUi(properties) {
// Set isOpen, wireEventBridge, set buttonActive as appropriate, // Set isOpen, wireEventBridge, set buttonActive as appropriate,
// and finally call onOpened() or onClosed() IFF defined. // and finally call onOpened() or onClosed() IFF defined.
that.setCurrentVisibleScreenMetadata(type, url); that.setCurrentVisibleScreenMetadata(type, url);
if (that.checkIsOpen(type, url)) { if (that.checkIsOpen(type, url)) {
that.wireEventBridge(true); that.wireEventBridge(true);
if (!that.isOpen) { if (!that.isOpen) {

View file

@ -576,9 +576,7 @@ function isReturnedDataEmpty(data) {
return historyArray.length === 0; return historyArray.length === 0;
} }
//
// Manage the connection between the button and the window.
//
var BUTTON_NAME = "WALLET"; var BUTTON_NAME = "WALLET";
var WALLET_QML_SOURCE = "hifi/commerce/wallet/Wallet.qml"; var WALLET_QML_SOURCE = "hifi/commerce/wallet/Wallet.qml";
var ui; var ui;

View file

@ -1040,15 +1040,16 @@ function notificationPollCallback(updatesArray) {
if (updatesArray.length > 0) { if (updatesArray.length > 0) {
var message; var message;
if (!ui.notificationInitialCallbackMade) { if (!ui.notificationInitialCallbackMade) {
message = updatesArray.length + " of your purchased items have updates available. " + message = updatesArray.length + " of your purchased items " +
"Open MARKET to update."; (updatesArray.length === 1 ? "has an update " : "have updates ") +
"available. Open MARKET to update.";
ui.notificationDisplayBanner(message); ui.notificationDisplayBanner(message);
ui.notificationPollCaresAboutSince = true; ui.notificationPollCaresAboutSince = true;
} else { } else {
for (var i = 0; i < updatesArray.length; i++) { for (var i = 0; i < updatesArray.length; i++) {
message = "Update available for \"" + message = "Update available for \"" +
updatesArray[i].marketplace_item_name + "\"." + updatesArray[i].base_item_title + "\"." +
"Open MARKET to update."; "Open MARKET to update.";
ui.notificationDisplayBanner(message); ui.notificationDisplayBanner(message);
} }
@ -1061,9 +1062,7 @@ function isReturnedDataEmpty(data) {
return historyArray.length === 0; return historyArray.length === 0;
} }
//
// Manage the connection between the button and the window.
//
var BUTTON_NAME = "MARKET"; var BUTTON_NAME = "MARKET";
var MARKETPLACE_URL = METAVERSE_SERVER_URL + "/marketplace"; var MARKETPLACE_URL = METAVERSE_SERVER_URL + "/marketplace";
var MARKETPLACE_URL_INITIAL = MARKETPLACE_URL + "?"; // Append "?" to signal injected script that it's the initial page. var MARKETPLACE_URL_INITIAL = MARKETPLACE_URL + "?"; // Append "?" to signal injected script that it's the initial page.