mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
fix/catch JSON.parse Syntax error when clearing up localStorage
This commit is contained in:
parent
6e5a691a74
commit
e1dd89c57a
@ -112,17 +112,22 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd)
|
|||||||
// Actual cached data
|
// Actual cached data
|
||||||
else if (key.indexOf(_prefix) == 0)
|
else if (key.indexOf(_prefix) == 0)
|
||||||
{
|
{
|
||||||
var cached = JSON.parse(window.localStorage.getItem(key));
|
try {
|
||||||
if(cached.timestamp)
|
let cached = JSON.parse(window.localStorage.getItem(key));
|
||||||
{
|
if(cached.timestamp)
|
||||||
indexes.push({
|
{
|
||||||
key: key,
|
indexes.push({
|
||||||
lastModification: cached.timestamp
|
key: key,
|
||||||
});
|
lastModification: cached.timestamp
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No way to know how old it is, just remove it
|
||||||
|
window.localStorage.removeItem(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (e) {
|
||||||
{
|
|
||||||
// No way to know how old it is, just remove it
|
|
||||||
window.localStorage.removeItem(key);
|
window.localStorage.removeItem(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user