Don't show banner when app is open but continue updating data

This commit is contained in:
Zach Fox 2018-09-21 10:46:49 -07:00
parent e75a45af92
commit 6284074ff9
2 changed files with 7 additions and 5 deletions

View file

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

View file

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