Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Notification bug fixes:

1. PutIO.UI.removeNotification(): use removeCurrentNotification() to simplify logic
2. PutIO.UI.addNotification(): use PutIO.UI.removeNotification() instead of calling Gecko's removeNotification() directly
3. PutIO.BrowserOverlay.saveLink(): use PutIO.UI.replaceNotification() when adding notifications, so as to replace any currently displayed notification, instead of blindly adding notifications that may be hidden behind the current notification (bad UX!)
  • Loading branch information...
commit e84189666d9497b544cc31092688e7b552322533 1 parent 7a28b67
@yuhui authored
Showing with 7 additions and 8 deletions.
  1. +1 −1  chrome/content/browser/browser.js
  2. +6 −7 chrome/content/ui.js
View
2  chrome/content/browser/browser.js
@@ -23,7 +23,7 @@ PutIO.BrowserOverlay = {
} else {
- PutIO.UI.addNotification(
+ PutIO.UI.replaceNotification(
notificationWindow,
["putio.saveLink.notification.label"],
saveLinkNotificationValue,
View
13 chrome/content/ui.js
@@ -196,7 +196,7 @@ PutIO.UI = {
popup : null,
callback : function() {
that.openActiveTransfers();
- notificationBox.removeNotification(notificationBox.getNotificationWithValue(notificationValue));
+ that.removeNotification(notificationWindow);
}
}
break;
@@ -224,16 +224,15 @@ PutIO.UI = {
);
},
- removeNotification : function(notificationWindow, value) {
- let notificationBox = getNotificationBox(notificationWindow);
- let thisNotification = notificationBox.getNotificationWithValue(value);
- if (thisNotification) {
- thisNotification = notificationBox.removeNotification(thisNotification);
+ removeNotification : function(notificationWindow) {
+ let notificationBox = getNotificationBox(notificationWindow);
+ if (notificationBox.currentNotification !== null) {
+ thisNotification = notificationBox.removeCurrentNotification();
}
},
replaceNotification : function(notificationWindow, labelWithArgv, value, priority, buttons) {
- this.removeNotification(notificationWindow, value);
+ this.removeNotification(notificationWindow);
this.addNotification(notificationWindow, labelWithArgv, value, priority, buttons);
}
Please sign in to comment.
Something went wrong with that request. Please try again.