mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
#5007 Web client attempts to post notifications without permission, causing transfers not to update
This commit is contained in:
parent
0a656a1375
commit
f6efebb25c
1 changed files with 11 additions and 9 deletions
|
@ -11,15 +11,17 @@ $(document).ready(function () {
|
||||||
toggle.show();
|
toggle.show();
|
||||||
updateMenuTitle();
|
updateMenuTitle();
|
||||||
$(transmission).bind('downloadComplete seedingComplete', function (event, torrent) {
|
$(transmission).bind('downloadComplete seedingComplete', function (event, torrent) {
|
||||||
var title = (event.type == 'downloadComplete' ? 'Download' : 'Seeding') + ' complete',
|
if (notificationsEnabled) {
|
||||||
content = torrent.getName(),
|
var title = (event.type == 'downloadComplete' ? 'Download' : 'Seeding') + ' complete',
|
||||||
notification;
|
content = torrent.getName(),
|
||||||
|
notification;
|
||||||
|
|
||||||
notification = window.webkitNotifications.createNotification('style/transmission/images/logo.png', title, content);
|
notification = window.webkitNotifications.createNotification('style/transmission/images/logo.png', title, content);
|
||||||
notification.show();
|
notification.show();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
notification.cancel();
|
notification.cancel();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateMenuTitle() {
|
function updateMenuTitle() {
|
||||||
|
|
Loading…
Reference in a new issue