File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -204,13 +204,13 @@ Vue.component('relative-time', {
204204
205205var vm = new Vue ( {
206206 created : function ( ) {
207- this . refreshStats ( )
208- . then ( this . refreshFeeds . bind ( this ) )
209- . then ( this . refreshItems . bind ( this , false ) )
210-
211- api . feeds . list_errors ( ) . then ( function ( errors ) {
212- vm . feed_errors = errors
213- } )
207+ this . refreshAll ( )
208+ this . interval = setInterval ( function ( ) {
209+ this . refreshAll ( )
210+ } . bind ( this ) , 300000 ) // every 5 minutes
211+ } ,
212+ destroyed : function ( ) {
213+ clearInterval ( this . interval )
214214 } ,
215215 data : function ( ) {
216216 var s = app . settings
@@ -252,6 +252,7 @@ var vm = new Vue({
252252 'refreshRate' : s . refresh_rate ,
253253 'authenticated' : app . authenticated ,
254254 'feed_errors' : { } ,
255+ 'interval' : null ,
255256 }
256257 } ,
257258 computed : {
@@ -396,6 +397,15 @@ var vm = new Vue({
396397 } )
397398 } )
398399 } ,
400+ refreshAll : function ( ) {
401+ this . refreshStats ( )
402+ . then ( this . refreshFeeds . bind ( this ) )
403+ . then ( this . refreshItems . bind ( this , false ) )
404+
405+ api . feeds . list_errors ( ) . then ( function ( errors ) {
406+ vm . feed_errors = errors
407+ } )
408+ } ,
399409 getItemsQuery : function ( ) {
400410 var query = { }
401411 if ( this . feedSelected ) {
You can’t perform that action at this time.
0 commit comments