Skip to content

Commit

Permalink
Merge pull request 3axap4eHko#20 from greneholt/master
Browse files Browse the repository at this point in the history
Fixing automatic closing of notifications
  • Loading branch information
3axap4eHko committed Mar 24, 2014
2 parents dc210ea + 6e28c60 commit 7d6523a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/exchange.js
Expand Up @@ -146,7 +146,9 @@ function Exchange() {
exchange.notify = window.webkitNotifications.createNotification(chrome.extension.getURL('images/icon128.png'), data.title, data.message);
exchange.notify.onclick = onclick || Function.empty;
exchange.notify.show();
setTimeout((function() { this.close();}).bind(exchange.notify), (exchange.options.displayTime || defaultConfig.displayTime) * 1000);
if (exchange.options.displayTime != 0) {
setTimeout((function() { exchange.notify && exchange.notify.cancel() }), exchange.options.displayTime * 1000);
}
} else {
window.webkitNotifications.requestPermission();
}
Expand All @@ -173,7 +175,7 @@ function Exchange() {
},
function() {
exchange.goToInbox();
this.close();
exchange.notify.cancel();
}
);

Expand Down
1 change: 1 addition & 0 deletions src/owa_options.html
Expand Up @@ -95,6 +95,7 @@ <h4>Settings error!</h4>
<span class="input-group-addon"> seconds</span>
</div>
</div>
<p>Set to 0 to display forever.</p>
</div>

<div class="form-group">
Expand Down

0 comments on commit 7d6523a

Please sign in to comment.