History

Reset IndexedDB when resetting the app

Thibaut committed 11 years ago

Commit 9cc6dc91 parent 25f844d2 files · +4 −0Browse files

Showing the changes to assets/javascripts (2 of 2 files). Show all

Unified · Split

2 files
  1. assets/javascripts/app/app.coffee +1 −0
  2. assets/javascripts/app/db.coffee +3 −0
assets/javascripts/app/app.coffee+1−0
@@ -110,6 +110,7 @@ · 109 unmodified lines
110110 reset: ->
111111 @store.clear()
112112 @settings.reset()
113+ @db.reset()
113114 @appCache?.update()
114115 window.location = '/'
115116 return
assets/javascripts/app/db.coffee+3−0
@@ -108,6 +108,9 @@ class app.DB · 107 unmodified lines
108108
109109 txn
110110
111+ reset: ->
112+ try indexedDB?.deleteDatabase(NAME) catch
113+
111114 useIndexedDB: ->
112115 !app.isSingleDoc() and !!window.indexedDB
113116