From 143a059b16cb5c429a352fb58c0d8aa352986b0a Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 17 Sep 2018 11:11:36 -0700 Subject: [PATCH] Small changes to AppUI and PAL --- scripts/modules/appUi.js | 7 +++---- scripts/system/pal.js | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/modules/appUi.js b/scripts/modules/appUi.js index 02beb41674..dab377911b 100644 --- a/scripts/modules/appUi.js +++ b/scripts/modules/appUi.js @@ -53,10 +53,7 @@ function AppUi(properties) { }; that.open = function open(optionalUrl, optionalInject) { // How to open the app. var url = optionalUrl || that.home; - var inject = that.inject; - if (optionalUrl && optionalInject) { - inject = optionalInject; - } + var inject = optionalInject || that.inject; if (that.isQMLUrl(url)) { that.tablet.loadQMLSource(url); @@ -108,6 +105,7 @@ function AppUi(properties) { }; that.notificationPollCallback = that.ignore; that.notificationPollCaresAboutSince = false; + that.notificationInitialCallbackMade = false; that.notificationDisplayBanner = function (message) { Window.displayAnnouncement(message); }; @@ -189,6 +187,7 @@ function AppUi(properties) { } console.debug(that.buttonName, 'notification data for processing:', JSON.stringify(notificationData)); that.notificationPollCallback(notificationData); + that.notificationInitialCallbackMade = true; currentDataPageToRetrieve = 1; concatenatedServerResponse = new Array(); } else { diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 1abac53f50..d9e99272ba 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -823,7 +823,6 @@ function notificationDataProcessPage(data) { } var shouldShowDot = false; -var firstBannerNotificationShown = false; function notificationPollCallback(onlineUsersArray) { shouldShowDot = onlineUsersArray.length > 0; @@ -835,10 +834,10 @@ function notificationPollCallback(onlineUsersArray) { }); var message; - if (!firstBannerNotificationShown) { - message = onlineUsersArray.length + " of your connections are online. Open PEOPLE to join them!"; + if (!ui.notificationInitialCallbackMade) { + message = onlineUsersArray.length + " of your connections " + + (onlineUsersArray.length === 1 ? "is" : "are") + " online. Open PEOPLE to join them!"; ui.notificationDisplayBanner(message); - firstBannerNotificationShown = true; } else { for (var i = 0; i < onlineUsersArray.length; i++) { message = onlineUsersArray[i].username + " is available in " +