From f6a8383d539c7544f47d43c3f8ee48cb49ae006d Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 10 Oct 2018 15:49:22 -0700 Subject: [PATCH] Bugfixes --- server-console/src/main.js | 11 +++++++---- server-console/src/modules/hf-notifications.js | 17 +++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 1db5283999..5c77c26270 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -569,20 +569,23 @@ function updateLabels(serverState) { labels.wallet.icon = pendingNotifications[HifiNotificationType.WALLET] ? menuNotificationIcon : null; labels.marketplace.icon = pendingNotifications[HifiNotificationType.MARKETPLACE] ? menuNotificationIcon : null; var onlineUsers = trayNotifications.getOnlineUsers(); - if(onlineUsers) { + if (onlineUsers) { labels.people.submenu = []; for (var name in onlineUsers) { labels.people.submenu.push({ label: name, + enabled: (onlineUsers[name].location != undefined), click: function () { - setNotificationState(HifiNotificationType.GOTO, false); - StartInterface("hifi://" + onlineUsers[name].location.root.name + onlineUsers[name].location.path); + setNotificationState(HifiNotificationType.PEOPLE, false); + if(onlineUsers[name] && onlineUsers[name].location) { + StartInterface("hifi://" + onlineUsers[name].location.root.name + onlineUsers[name].location.path); + } } }); } } var currentStories = trayNotifications.getCurrentStories(); - if(currentStories) { + if (currentStories && currentStories.length) { labels.goto.submenu = []; for (var location in currentStories) { labels.goto.submenu.push({ diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 85fe3ece15..2b287ba392 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -73,11 +73,17 @@ HifiNotification.prototype = { text = this.data + " of your connections are online." } message = "Click to open PEOPLE."; - url="hifiapp:PEOPLE" + url="hifiapp:PEOPLE"; } else { - text = this.data.username + " is available in " + this.data.location.root.name + "."; - message = "Click to join them."; - url="hifi://" + this.data.location.root.name + this.data.location.path; + if (this.data.location) { + text = this.data.username + " is available in " + this.data.location.root.name + "."; + message = "Click to join them."; + url="hifi://" + this.data.location.root.name + this.data.location.path; + } else { + text = this.data.username + " is online."; + message = "Click to open PEOPLE."; + url="hifiapp:PEOPLE"; + } } break; @@ -433,7 +439,6 @@ HifiNotifications.prototype = { console.log("Error: unable to get " + url); return false; } - console.log(content); if (!content.total_entries) { _this.menuNotificationCallback(NotificationType.PEOPLE, false); _this.onlineUsers = {}; @@ -445,7 +450,7 @@ HifiNotifications.prototype = { content.data.users.forEach(function (user) { currentUsers[user.username] = user; if (!(user.username in _this.onlineUsers)) { - newUsers.add(user.username); + newUsers.add(user); _this.onlineUsers[user.username] = user; } });