Small changes to AppUI and PAL

This commit is contained in:
Zach Fox 2018-09-17 11:11:36 -07:00
parent 23fab0985b
commit 143a059b16
2 changed files with 6 additions and 8 deletions

View file

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

View file

@ -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 " +