mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-31 12:02:44 +00:00
Enhance detection of PV key validity in localStorage
This commit is contained in:
@@ -75,14 +75,20 @@ const PvStorage = (function () {
|
||||
return PvStorage.getAllPageviews() > pv.totalsForAllResults["ga:pageviews"];
|
||||
},
|
||||
inspectKeys() {
|
||||
if (localStorage.getItem(KEY_PV) === null
|
||||
|| localStorage.getItem(KEY_CREATION) === null) {
|
||||
localStorage.clear();
|
||||
for(let i = 0; i < localStorage.length; i++){
|
||||
const key = localStorage.key(i);
|
||||
switch (key) {
|
||||
case KEY_PV:
|
||||
case KEY_CREATION:
|
||||
break;
|
||||
default:
|
||||
localStorage.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}()); /* PvData */
|
||||
}()); /* PvStorage */
|
||||
|
||||
function countUp(min, max, destId) {
|
||||
if (min < max) {
|
||||
|
||||
Reference in New Issue
Block a user