mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Dashboard JS checks version every 12 hours
This commit is contained in:
parent
ea861ebb57
commit
0321643636
1 changed files with 13 additions and 6 deletions
|
@ -3,23 +3,30 @@
|
|||
/**
|
||||
Handles the default admin route
|
||||
|
||||
@class AdminDashboardRoute
|
||||
@class AdminDashboardRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
||||
setupController: function(c) {
|
||||
if( Discourse.SiteSettings.version_checks ) {
|
||||
Discourse.VersionCheck.find().then(function(vc) {
|
||||
c.set('versionCheck', vc);
|
||||
c.set('loading', false);
|
||||
});
|
||||
if( !c.get('versionCheckedAt') || Date.create('12 hours ago') > c.get('versionCheckedAt') ) {
|
||||
this.checkVersion(c);
|
||||
}
|
||||
},
|
||||
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
},
|
||||
|
||||
checkVersion: function(c) {
|
||||
if( Discourse.SiteSettings.version_checks ) {
|
||||
Discourse.VersionCheck.find().then(function(vc) {
|
||||
c.set('versionCheck', vc);
|
||||
c.set('versionCheckedAt', new Date());
|
||||
c.set('loading', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue