From 6284074ff96f076f9395fdc02a7e478b577ab29a Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 21 Sep 2018 10:46:49 -0700 Subject: [PATCH] Don't show banner when app is open but continue updating data --- scripts/modules/appUi.js | 8 +++++--- scripts/system/marketplaces/marketplaces.js | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/modules/appUi.js b/scripts/modules/appUi.js index 10c3ed023c..78e9ed38f0 100644 --- a/scripts/modules/appUi.js +++ b/scripts/modules/appUi.js @@ -107,7 +107,9 @@ function AppUi(properties) { that.notificationPollCaresAboutSince = false; that.notificationInitialCallbackMade = false; that.notificationDisplayBanner = function (message) { - Window.displayAnnouncement(message); + if (that.isOpen) { + Window.displayAnnouncement(message); + } }; // // END Notification Handling Defaults @@ -155,8 +157,8 @@ function AppUi(properties) { return; } - // User is "appearing offline", or is offline, or the app is open - if (GlobalServices.findableBy === "none" || Account.username === "" || that.isOpen) { + // User is "appearing offline" or is offline + if (GlobalServices.findableBy === "none" || Account.username === "") { that.notificationPollTimeout = Script.setTimeout(that.notificationPoll, that.notificationPollTimeoutMs); return; } diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index d535884c94..3a239aa774 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -909,7 +909,7 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) { break; case 'purchases_availableUpdatesReceived': shouldShowDot = message.numUpdates > 0; - ui.messagesWaiting(shouldShowDot); + ui.messagesWaiting(shouldShowDot && !ui.isOpen); break; case 'purchases_updateWearables': var currentlyWornWearables = []; @@ -1035,7 +1035,7 @@ function notificationDataProcessPage(data) { var shouldShowDot = false; function notificationPollCallback(updatesArray) { shouldShowDot = shouldShowDot || updatesArray.length > 0; - ui.messagesWaiting(shouldShowDot); + ui.messagesWaiting(shouldShowDot && !ui.isOpen); if (updatesArray.length > 0) { var message;