mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-12 09:13:07 +01:00
Fix Notification.requestPermission on first run
This commit is contained in:
parent
30c4f7ed41
commit
647c0618ce
@ -58,7 +58,11 @@ $(document).ready(function(){
|
|||||||
var setting = $(this).parent().attr('id');
|
var setting = $(this).parent().attr('id');
|
||||||
|
|
||||||
if ($(this).is(':checked')) {
|
if ($(this).is(':checked')) {
|
||||||
Notification.requestPermission();
|
Notification.requestPermission(function(permission){
|
||||||
|
if (permission === "granted") {
|
||||||
|
localStorage[setting] = 'true';
|
||||||
|
}
|
||||||
|
});
|
||||||
if (Notification.permission === "granted") {
|
if (Notification.permission === "granted") {
|
||||||
localStorage[setting] = 'true';
|
localStorage[setting] = 'true';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user