mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
fix/catch JSON.parse Syntax error when clearing up localStorage
This commit is contained in:
parent
6e5a691a74
commit
e1dd89c57a
@ -112,7 +112,8 @@ 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 {
|
||||||
|
let cached = JSON.parse(window.localStorage.getItem(key));
|
||||||
if(cached.timestamp)
|
if(cached.timestamp)
|
||||||
{
|
{
|
||||||
indexes.push({
|
indexes.push({
|
||||||
@ -126,6 +127,10 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd)
|
|||||||
window.localStorage.removeItem(key);
|
window.localStorage.removeItem(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (e) {
|
||||||
|
window.localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Nothing for that prefix? Clear all cached data.
|
// Nothing for that prefix? Clear all cached data.
|
||||||
if(_prefix && indexes.length == 0)
|
if(_prefix && indexes.length == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user