mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Fixes #1382 gracefully recovers from local storage write error
This commit is contained in:
@@ -57,12 +57,18 @@
|
||||
* @param data {mixed}
|
||||
*/
|
||||
LocalStorageCache.prototype.set = function(data) {
|
||||
if (this.ready) {
|
||||
this.storage[this.key] = JSON.stringify({
|
||||
timestamp: new Date().getTime(),
|
||||
key: this.serverKey,
|
||||
data: data
|
||||
});
|
||||
try {
|
||||
if (this.ready) {
|
||||
this.storage[this.key] = JSON.stringify({
|
||||
timestamp: new Date().getTime(),
|
||||
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