Changeset 13422


Ignore:
Timestamp:
Aug 7, 2012, 11:00:10 PM (9 years ago)
Author:
livings124
Message:

#5007 Web client attempts to post notifications without permission, causing transfers not to update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/notifications.js

    r13308 r13422  
    1212  updateMenuTitle();
    1313  $(transmission).bind('downloadComplete seedingComplete', function (event, torrent) {
    14     var title = (event.type == 'downloadComplete' ? 'Download' : 'Seeding') + ' complete',
    15         content = torrent.getName(),
    16         notification;
    17 
    18     notification = window.webkitNotifications.createNotification('style/transmission/images/logo.png', title, content);
    19     notification.show();
    20     setTimeout(function () {
    21       notification.cancel();
    22     }, 5000);
     14        if (notificationsEnabled) {
     15                var title = (event.type == 'downloadComplete' ? 'Download' : 'Seeding') + ' complete',
     16                        content = torrent.getName(),
     17                        notification;
     18       
     19                notification = window.webkitNotifications.createNotification('style/transmission/images/logo.png', title, content);
     20                notification.show();
     21                setTimeout(function () {
     22                  notification.cancel();
     23                }, 5000);
     24        };
    2325  });
    2426
Note: See TracChangeset for help on using the changeset viewer.