|
@@ -13,9 +13,6 @@ class app.AppCache
|
|
|
$.on @cache, 'progress', @onProgress
|
|
$.on @cache, 'progress', @onProgress
|
|
|
$.on @cache, 'updateready', @onUpdateReady
|
|
$.on @cache, 'updateready', @onUpdateReady
|
|
|
|
|
|
|
|
- @lastCheck = Date.now()
|
|
|
|
|
- $.on window, 'focus', @checkForUpdate
|
|
|
|
|
-
|
|
|
|
|
update: ->
|
|
update: ->
|
|
|
try @cache.update() catch
|
|
try @cache.update() catch
|
|
|
return
|
|
return
|
|
@@ -26,17 +23,10 @@ class app.AppCache
|
|
|
@update()
|
|
@update()
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- checkForUpdate: =>
|
|
|
|
|
- if Date.now() - @lastCheck > 86400e3
|
|
|
|
|
- @lastCheck = Date.now()
|
|
|
|
|
- @update()
|
|
|
|
|
- return
|
|
|
|
|
-
|
|
|
|
|
onProgress: (event) =>
|
|
onProgress: (event) =>
|
|
|
@trigger 'progress', event
|
|
@trigger 'progress', event
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
onUpdateReady: =>
|
|
onUpdateReady: =>
|
|
|
- new app.views.Notif 'UpdateReady', autoHide: null unless @reloading
|
|
|
|
|
- @trigger 'updateready'
|
|
|
|
|
|
|
+ @trigger 'updateready' unless @reloading
|
|
|
return
|
|
return
|