fix: wrap localStorage sets in try/catch
This commit is contained in:
parent
9f7725cec1
commit
e0b70d53cd
@ -70,7 +70,11 @@ class Storage {
|
||||
extend(storage, object);
|
||||
|
||||
// Update storage
|
||||
try {
|
||||
window.localStorage.setItem(this.key, JSON.stringify(storage));
|
||||
} catch (_) {
|
||||
// Do nothing
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60,12 +60,16 @@ export default function loadSprite(url, id) {
|
||||
}
|
||||
|
||||
if (useStorage) {
|
||||
try {
|
||||
window.localStorage.setItem(
|
||||
`${prefix}-${id}`,
|
||||
JSON.stringify({
|
||||
content: result,
|
||||
}),
|
||||
);
|
||||
} catch (_) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
update(container, result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user