Unified · Split
| @@ -37,7 +37,8 @@ class app.DB · 36 unmodified lines | ||
| 37 | 37 | db.close() |
| 38 | 38 | return |
| 39 | 39 | |
| 40 | − onOpenError: => | |
| 40 | + onOpenError: (event) => | |
| 41 | + event?.preventDefault() | |
| 41 | 42 | @useIndexedDB = @open = false |
| 42 | 43 | @runCallbacks() |
| 43 | 44 | return |
| @@ -114,8 +115,13 @@ class app.DB · 70 unmodified lines | ||
| 114 | 115 | store = txn.objectStore('docs') |
| 115 | 116 | |
| 116 | 117 | req = store.get(doc.slug) |
| 117 | − req.onsuccess = -> fn(req.result) | |
| 118 | − req.onerror = -> fn(false) | |
| 118 | + req.onsuccess = -> | |
| 119 | + fn(req.result) | |
| 120 | + return | |
| 121 | + req.onerror = (event) -> | |
| 122 | + event.preventDefault() | |
| 123 | + fn(false) | |
| 124 | + return | |
| 119 | 125 | return |
| 120 | 126 | return |
| 121 | 127 | |
| @@ -140,8 +146,13 @@ class app.DB · 18 unmodified lines | ||
| 140 | 146 | |
| 141 | 147 | docs.forEach (doc) -> |
| 142 | 148 | req = store.get(doc.slug) |
| 143 | − req.onsuccess = -> result[doc.slug] = req.result | |
| 144 | − req.onerror = -> result[doc.slug] = false | |
| 149 | + req.onsuccess = -> | |
| 150 | + result[doc.slug] = req.result | |
| 151 | + return | |
| 152 | + req.onerror = (event) -> | |
| 153 | + event.preventDefault() | |
| 154 | + result[doc.slug] = false | |
| 155 | + return | |
| 145 | 156 | return |
| 146 | 157 | return |
| 147 | 158 | |
| @@ -175,8 +186,13 @@ class app.DB · 27 unmodified lines | ||
| 175 | 186 | store = txn.objectStore(entry.doc.slug) |
| 176 | 187 | |
| 177 | 188 | req = store.get(entry.dbPath()) |
| 178 | − req.onsuccess = -> if req.result then onSuccess(req.result) else onError() | |
| 179 | − req.onerror = onError | |
| 189 | + req.onsuccess = -> | |
| 190 | + if req.result then onSuccess(req.result) else onError() | |
| 191 | + return | |
| 192 | + req.onerror = (event) -> | |
| 193 | + event.preventDefault() | |
| 194 | + onError() | |
| 195 | + return | |
| 180 | 196 | @loadDocsCache(db) unless @cachedDocs |
| 181 | 197 | return |
| 182 | 198 | |
| @@ -192,6 +208,9 @@ class app.DB · 9 unmodified lines | ||
| 192 | 208 | @cachedDocs[cursor.key] = cursor.value |
| 193 | 209 | cursor.continue() |
| 194 | 210 | return |
| 211 | + req.onerror = (event) -> | |
| 212 | + event.preventDefault() | |
| 213 | + return | |
| 195 | 214 | return |
| 196 | 215 | |
| 197 | 216 | shouldLoadWithIDB: (entry) -> |