mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-04 00:42:20 +02:00
Fixes #1382 gracefully recovers from local storage write error
This commit is contained in:
@@ -57,12 +57,18 @@
|
|||||||
* @param data {mixed}
|
* @param data {mixed}
|
||||||
*/
|
*/
|
||||||
LocalStorageCache.prototype.set = function(data) {
|
LocalStorageCache.prototype.set = function(data) {
|
||||||
if (this.ready) {
|
try {
|
||||||
this.storage[this.key] = JSON.stringify({
|
if (this.ready) {
|
||||||
timestamp: new Date().getTime(),
|
this.storage[this.key] = JSON.stringify({
|
||||||
key: this.serverKey,
|
timestamp: new Date().getTime(),
|
||||||
data: data
|
key: this.serverKey,
|
||||||
});
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Local storage error:");
|
||||||
|
console.log(e);
|
||||||
|
console.log("Use of direct result from Piwigo API.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user