mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-06 20:53:54 +02:00
more bug fixes and cleanup of some console logging
This commit is contained in:
parent
f6a8383d53
commit
af055bb45c
2 changed files with 22 additions and 15 deletions
|
@ -338,13 +338,15 @@ const HifiNotificationType = hfNotifications.NotificationType;
|
|||
var pendingNotifications = {}
|
||||
var notificationState = NotificationState.UNNOTIFIED;
|
||||
|
||||
function setNotificationState (notificationType, pending = true) {
|
||||
pendingNotifications[notificationType] = pending;
|
||||
notificationState = NotificationState.UNNOTIFIED;
|
||||
for (var key in pendingNotifications) {
|
||||
if (pendingNotifications[key]) {
|
||||
notificationState = NotificationState.NOTIFIED;
|
||||
break;
|
||||
function setNotificationState (notificationType, pending = undefined) {
|
||||
if (pending !== undefined) {
|
||||
pendingNotifications[notificationType] = pending;
|
||||
notificationState = NotificationState.UNNOTIFIED;
|
||||
for (var key in pendingNotifications) {
|
||||
if (pendingNotifications[key]) {
|
||||
notificationState = NotificationState.NOTIFIED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED);
|
||||
|
@ -569,9 +571,12 @@ function updateLabels(serverState) {
|
|||
labels.wallet.icon = pendingNotifications[HifiNotificationType.WALLET] ? menuNotificationIcon : null;
|
||||
labels.marketplace.icon = pendingNotifications[HifiNotificationType.MARKETPLACE] ? menuNotificationIcon : null;
|
||||
var onlineUsers = trayNotifications.getOnlineUsers();
|
||||
delete labels.people.submenu;
|
||||
if (onlineUsers) {
|
||||
labels.people.submenu = [];
|
||||
for (var name in onlineUsers) {
|
||||
if(labels.people.submenu == undefined) {
|
||||
labels.people.submenu = [];
|
||||
}
|
||||
labels.people.submenu.push({
|
||||
label: name,
|
||||
enabled: (onlineUsers[name].location != undefined),
|
||||
|
@ -585,14 +590,17 @@ function updateLabels(serverState) {
|
|||
}
|
||||
}
|
||||
var currentStories = trayNotifications.getCurrentStories();
|
||||
if (currentStories && currentStories.length) {
|
||||
labels.goto.submenu = [];
|
||||
delete labels.goto.submenu;
|
||||
if (currentStories) {
|
||||
for (var location in currentStories) {
|
||||
if(labels.goto.submenu == undefined) {
|
||||
labels.goto.submenu = [];
|
||||
}
|
||||
labels.goto.submenu.push({
|
||||
label: "event in " + location,
|
||||
click: function () {
|
||||
setNotificationState(HifiNotificationType.GOTO, false);
|
||||
StartInterface("hifi://" + location + getCurrentStories[location].path);
|
||||
StartInterface("hifi://" + location + currentStories[location].path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -302,7 +302,6 @@ HifiNotifications.prototype = {
|
|||
finished(false);
|
||||
return;
|
||||
}
|
||||
console.log(content);
|
||||
if (!content.total_entries) {
|
||||
finished(true, token);
|
||||
return;
|
||||
|
@ -326,7 +325,6 @@ HifiNotifications.prototype = {
|
|||
notifyData = content.data.updates;
|
||||
break;
|
||||
}
|
||||
|
||||
notifyData.forEach(function (notifyDataEntry) {
|
||||
_this._addNotification(new HifiNotification(notifyType, notifyDataEntry));
|
||||
});
|
||||
|
@ -381,13 +379,13 @@ HifiNotifications.prototype = {
|
|||
finished(false);
|
||||
return;
|
||||
}
|
||||
console.log(content);
|
||||
|
||||
if (!content.total_entries) {
|
||||
finished(true, token);
|
||||
return;
|
||||
}
|
||||
if (!content.total_entries) {
|
||||
this.menuNotificationCallback(NotificationType.GOTO, false);
|
||||
_this.menuNotificationCallback(NotificationType.GOTO, false);
|
||||
}
|
||||
_this.currentStories = {};
|
||||
content.user_stories.forEach(function (story) {
|
||||
|
@ -397,6 +395,7 @@ HifiNotifications.prototype = {
|
|||
// for each story.
|
||||
_this.currentStories[story.place_name] = story;
|
||||
});
|
||||
_this.menuNotificationCallback(NotificationType.GOTO);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue