Don't set the dn variable unless it's needed.

pull/87/head
Rimas Kudelis 12 years ago
parent 2b81b0bf11
commit 28d3ba505d

@ -118,8 +118,7 @@ function newmail_notifier_desktop(body)
function newmail_notifier_test_desktop() function newmail_notifier_test_desktop()
{ {
var dn = window.webkitNotifications, var txt = rcmail.gettext('testbody', 'newmail_notifier');
txt = rcmail.gettext('testbody', 'newmail_notifier');
// W3C draft implementation (with fix for Chrome/Chromium) // W3C draft implementation (with fix for Chrome/Chromium)
try { try {
@ -129,6 +128,7 @@ function newmail_notifier_test_desktop()
} }
// webkit implementation // webkit implementation
catch (e) { catch (e) {
var dn = window.webkitNotifications;
if (dn) { if (dn) {
if (!dn.checkPermission()) if (!dn.checkPermission())
newmail_notifier_desktop(txt); newmail_notifier_desktop(txt);
@ -161,4 +161,4 @@ function newmail_notifier_desktop_authorize() {
if (perm == 'granted') if (perm == 'granted')
newmail_notifier_test_desktop(); // Test again, which should show test message newmail_notifier_test_desktop(); // Test again, which should show test message
}); });
} }

Loading…
Cancel
Save