1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-31 12:23:48 +01:00

Fix Notification.requestPermission on first run

This commit is contained in:
8chan 2015-03-14 00:03:54 -07:00
parent 30c4f7ed41
commit 647c0618ce

View File

@ -58,7 +58,11 @@ $(document).ready(function(){
var setting = $(this).parent().attr('id');
if ($(this).is(':checked')) {
Notification.requestPermission();
Notification.requestPermission(function(permission){
if (permission === "granted") {
localStorage[setting] = 'true';
}
});
if (Notification.permission === "granted") {
localStorage[setting] = 'true';
}