Fixed check to not use cookies and use localStorage instead
This commit is contained in:
parent
390d9d497e
commit
5e87b3d2d3
|
@ -609,23 +609,19 @@ function exportNotes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFirstTimeVisitor() {
|
function isFirstTimeVisitor() {
|
||||||
if (document.cookie.indexOf("visited=true") !== -1) {
|
if (localStorage.getItem("FIRSTVISIT") === null) {
|
||||||
return false;
|
localStorage.setItem("FIRSTVISIT", "1")
|
||||||
} else {
|
|
||||||
var expirationDate = new Date();
|
|
||||||
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
|
||||||
document.cookie = "visited=true; expires=" + expirationDate.toUTCString() + "; path=/; SameSite=strict";
|
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function firstNewVersion() {
|
function firstNewVersion() {
|
||||||
if (document.cookie.indexOf("version=1.2") !== -1) {
|
if (localStorage.getItem("NEWVERSION") == "1.2") {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
var expirationDate = new Date();
|
localStorage.setItem("NEWVERSION", "1.2")
|
||||||
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
|
||||||
document.cookie = "version=1.2; expires=" + expirationDate.toUTCString() + "; path=/; SameSite=strict";
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue