1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-12 13:33:44 +00:00

Browser-storage: Handle quota exceeded error

This commit is contained in:
Jermolene
2019-02-03 17:29:32 +00:00
parent e31c5563ff
commit 6f5f9ca2fb
3 changed files with 23 additions and 5 deletions

View File

@@ -28,7 +28,6 @@ function hookBootTiddlersLoaded() {
for(var index=0; index<window.localStorage.length; index++) {
var key = window.localStorage.key(index),
parts = key.split("#");
console.log("key",key)
// If it's ours
if(parts[0] === "tw5" && parts[1] === url) {
// Read it as JSON
@@ -45,7 +44,6 @@ console.log("key",key)
// Get any existing tiddler
var title = incomingTiddler.fields.title,
existingTiddler = $tw.wiki.getTiddler(title);
console.log("Existing",title,existingTiddler,existingTiddler && existingTiddler.isEqual(incomingTiddler))
if(existingTiddler && existingTiddler.isEqual(incomingTiddler)) {
// If the incoming tiddler is the same as the existing then we can delete the local storage version
window.localStorage.removeItem(key);