New Update notification only show once a week
This commit is contained in:
parent
8a33cd9a89
commit
10eb6d1735
@ -385,21 +385,24 @@
|
|||||||
var latestVersion = data.version;
|
var latestVersion = data.version;
|
||||||
if (localVersion !== latestVersion) {
|
if (localVersion !== latestVersion) {
|
||||||
$('#version').html('Latest Version: ' + latestVersion);
|
$('#version').html('Latest Version: ' + latestVersion);
|
||||||
Swal.fire({
|
if(getCookie(latestVersion) != 'done'){
|
||||||
icon: 'info',
|
Swal.fire({
|
||||||
title: "New Version Available\nVersion: "+latestVersion,
|
icon: 'info',
|
||||||
toast: true,
|
title: "New Version Available\nVersion: "+latestVersion,
|
||||||
position: 'bottom-right',
|
toast: true,
|
||||||
showConfirmButton: true,
|
position: 'bottom-right',
|
||||||
showCloseButton: true,
|
showConfirmButton: true,
|
||||||
timer: 30000,
|
showCloseButton: true,
|
||||||
confirmButtonText: '<a href="{$_url}community#latestVersion" style="color: white;">Update Now</a>',
|
timer: 30000,
|
||||||
timerProgressBar: true,
|
confirmButtonText: '<a href="{$_url}community#latestVersion" style="color: white;">Update Now</a>',
|
||||||
didOpen: (toast) => {
|
timerProgressBar: true,
|
||||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
didOpen: (toast) => {
|
||||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||||
}
|
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
setCookie(latestVersion, 'done', 7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user