mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Add a few missing returns
This commit is contained in:
parent
afbe4c3846
commit
ba09a14ec0
2 changed files with 15 additions and 2 deletions
|
@ -60,7 +60,9 @@ class app.DB
|
||||||
return
|
return
|
||||||
|
|
||||||
txn = db.transaction ['docs', doc.slug], 'readwrite'
|
txn = db.transaction ['docs', doc.slug], 'readwrite'
|
||||||
txn.oncomplete = -> if txn.error then onError() else onSuccess()
|
txn.oncomplete = ->
|
||||||
|
if txn.error then onError() else onSuccess()
|
||||||
|
return
|
||||||
|
|
||||||
store = txn.objectStore(doc.slug)
|
store = txn.objectStore(doc.slug)
|
||||||
store.clear()
|
store.clear()
|
||||||
|
@ -78,7 +80,9 @@ class app.DB
|
||||||
return
|
return
|
||||||
|
|
||||||
txn = db.transaction ['docs', doc.slug], 'readwrite'
|
txn = db.transaction ['docs', doc.slug], 'readwrite'
|
||||||
txn.oncomplete = -> if txn.error then onError() else onSuccess()
|
txn.oncomplete = ->
|
||||||
|
if txn.error then onError() else onSuccess()
|
||||||
|
return
|
||||||
|
|
||||||
store = txn.objectStore(doc.slug)
|
store = txn.objectStore(doc.slug)
|
||||||
store.clear()
|
store.clear()
|
||||||
|
@ -154,6 +158,7 @@ class app.DB
|
||||||
|
|
||||||
reset: ->
|
reset: ->
|
||||||
try indexedDB?.deleteDatabase(NAME) catch
|
try indexedDB?.deleteDatabase(NAME) catch
|
||||||
|
return
|
||||||
|
|
||||||
useIndexedDB: ->
|
useIndexedDB: ->
|
||||||
!app.isSingleDoc() and !!window.indexedDB
|
!app.isSingleDoc() and !!window.indexedDB
|
||||||
|
|
|
@ -54,6 +54,7 @@ class app.models.Doc extends app.Model
|
||||||
@reset data
|
@reset data
|
||||||
onSuccess()
|
onSuccess()
|
||||||
@_setCache data if options.writeCache
|
@_setCache data if options.writeCache
|
||||||
|
return
|
||||||
|
|
||||||
ajax
|
ajax
|
||||||
url: @indexUrl()
|
url: @indexUrl()
|
||||||
|
@ -70,6 +71,7 @@ class app.models.Doc extends app.Model
|
||||||
callback = =>
|
callback = =>
|
||||||
@reset data
|
@reset data
|
||||||
onSuccess()
|
onSuccess()
|
||||||
|
return
|
||||||
|
|
||||||
setTimeout callback, 0
|
setTimeout callback, 0
|
||||||
true
|
true
|
||||||
|
@ -94,10 +96,12 @@ class app.models.Doc extends app.Model
|
||||||
error = =>
|
error = =>
|
||||||
@downloading = null
|
@downloading = null
|
||||||
onError()
|
onError()
|
||||||
|
return
|
||||||
|
|
||||||
success = (data) =>
|
success = (data) =>
|
||||||
@downloading = null
|
@downloading = null
|
||||||
app.db.store @, data, onSuccess, error
|
app.db.store @, data, onSuccess, error
|
||||||
|
return
|
||||||
|
|
||||||
ajax
|
ajax
|
||||||
url: @dbUrl()
|
url: @dbUrl()
|
||||||
|
@ -112,13 +116,17 @@ class app.models.Doc extends app.Model
|
||||||
success = =>
|
success = =>
|
||||||
@downloading = null
|
@downloading = null
|
||||||
onSuccess()
|
onSuccess()
|
||||||
|
return
|
||||||
|
|
||||||
error = =>
|
error = =>
|
||||||
@downloading = null
|
@downloading = null
|
||||||
onError()
|
onError()
|
||||||
|
return
|
||||||
|
|
||||||
app.db.unstore @, success, error
|
app.db.unstore @, success, error
|
||||||
|
return
|
||||||
|
|
||||||
getDownloadStatus: (callback) ->
|
getDownloadStatus: (callback) ->
|
||||||
app.db.version @, (value) ->
|
app.db.version @, (value) ->
|
||||||
callback downloaded: !!value, version: value
|
callback downloaded: !!value, version: value
|
||||||
|
return
|
||||||
|
|
Loading…
Reference in a new issue