Search for interface should check peer package

Also, retain enabled/disabled state for notifications across restarts
This commit is contained in:
Roxanne Skelly 2018-09-27 11:10:51 -07:00
parent 61aef14c64
commit d851e3994e
2 changed files with 16 additions and 14 deletions

View file

@ -146,7 +146,6 @@ function HifiNotifications(config, menuNotificationCallback) {
var _menuNotificationCallback = menuNotificationCallback; var _menuNotificationCallback = menuNotificationCallback;
notifier.on('click', function (notifierObject, options) { notifier.on('click', function (notifierObject, options) {
console.log("click.");
StartInterface(options.url); StartInterface(options.url);
_menuNotificationCallback(options.notificationType, false); _menuNotificationCallback(options.notificationType, false);
}); });
@ -185,6 +184,18 @@ HifiNotifications.prototype = {
}, },
MARKETPLACE_NOTIFICATION_POLL_TIME_MS); MARKETPLACE_NOTIFICATION_POLL_TIME_MS);
} else { } else {
this.stopPolling();
}
},
enabled: function () {
return !this.config.get("disableTrayNotifications", false);
},
stopPolling: function () {
this.config.set("storiesNotifySince", this.storiesSince.toISOString());
this.config.set("peopleNotifySince", this.peopleSince.toISOString());
this.config.set("walletNotifySince", this.walletSince.toISOString());
this.config.set("marketplaceNotifySince", this.marketplaceSince.toISOString());
if (this.storiesPollTimer) { if (this.storiesPollTimer) {
clearInterval(this.storiesPollTimer); clearInterval(this.storiesPollTimer);
} }
@ -197,18 +208,6 @@ HifiNotifications.prototype = {
if (this.marketplacePollTimer) { if (this.marketplacePollTimer) {
clearInterval(this.marketplacePollTimer); clearInterval(this.marketplacePollTimer);
} }
}
},
enabled: function () {
return !this.config.get("disableTrayNotifications", false);
},
stopPolling: function () {
this.config.set("storiesNotifySince", this.storiesSince.toISOString());
this.config.set("peopleNotifySince", this.peopleSince.toISOString());
this.config.set("walletNotifySince", this.walletSince.toISOString());
this.config.set("marketplaceNotifySince", this.marketplaceSince.toISOString());
this.enable(false);
}, },
_showNotification: function () { _showNotification: function () {
var _this = this; var _this = this;

View file

@ -55,6 +55,9 @@ exports.searchPaths = function(name, binaryType, releaseType) {
// check beside the app bundle for the binaries // check beside the app bundle for the binaries
paths.push(path.join(path.dirname(appPath), name + extension)); paths.push(path.join(path.dirname(appPath), name + extension));
// check in the peer bundle for the binaries
paths.push(path.join("..", name + extension));
} }
} }
} }