Fixes #154
Showing the changes to assets/javascripts/app (2 of 3 files). Show all
Unified · Split
| @@ -132,6 +132,10 @@ · 131 unmodified lines | ||
| 132 | 132 | @hideLoading() |
| 133 | 133 | return |
| 134 | 134 | |
| 135 | + onQuotaExceeded: -> | |
| 136 | + new app.views.Notif 'QuotaExceeded', autoHide: null | |
| 137 | + Raven.captureMessage 'QuotaExceededError' | |
| 138 | + | |
| 135 | 139 | onWindowError: (args...) -> |
| 136 | 140 | if @isInjectionError args... |
| 137 | 141 | @onInjectionError() |
| @@ -8,7 +8,7 @@ class app.DB · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | db: (fn) -> |
| 10 | 10 | return fn() unless @useIndexedDB |
| 11 | − @callbacks.push(fn) | |
| 11 | + @callbacks.push(fn) if fn | |
| 12 | 12 | return if @open |
| 13 | 13 | |
| 14 | 14 | try |
| @@ -39,8 +39,15 @@ class app.DB · 24 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | onOpenError: (event) => |
| 41 | 41 | event?.preventDefault() |
| 42 | − @useIndexedDB = @open = false | |
| 43 | − @runCallbacks() | |
| 42 | + @open = false | |
| 43 | + | |
| 44 | + if event?.target?.error?.name is 'QuotaExceededError' | |
| 45 | + @reset() | |
| 46 | + @db() | |
| 47 | + app.onQuotaExceeded() | |
| 48 | + else | |
| 49 | + @useIndexedDB = false | |
| 50 | + @runCallbacks() | |
| 44 | 51 | return |
| 45 | 52 | |
| 46 | 53 | runCallbacks: (db) -> |