settings: new option to postpone the activation of the given settings file
This commit is contained in:
parent
8e6b8829ea
commit
9be56fb9a2
5 changed files with 47 additions and 16 deletions
|
|
@ -84,11 +84,15 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
refreshSettingsInterval = $interval(refreshSettings, Math.floor(Math.random() * 24000) + 32000);
|
||||
|
||||
$http.get("/settings.json").then(function(response) {
|
||||
$rootScope.recvTime(response);
|
||||
var time = $rootScope.recvTime(response);
|
||||
response.data.start = new Date(response.data.start);
|
||||
response.data.end = new Date(response.data.end);
|
||||
response.data.generation = new Date(response.data.generation);
|
||||
$rootScope.settings = response.data;
|
||||
response.data.activateTime = new Date(response.data.activateTime);
|
||||
if (response.data.activateTime <= new Date(Date.now() + (time.cu - time.he)))
|
||||
$rootScope.settings = response.data;
|
||||
else
|
||||
$rootScope.settings.activateTime = response.data.activateTime;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -210,12 +214,15 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
actMenu();
|
||||
}
|
||||
|
||||
$rootScope.refresh = function(justMy) {
|
||||
$rootScope.refresh = function(justMy, justSettings) {
|
||||
if (!justMy) {
|
||||
refreshSettings();
|
||||
refreshThemes();
|
||||
$rootScope.refreshTeams();
|
||||
}
|
||||
else if (justSettings) {
|
||||
refreshSettings();
|
||||
}
|
||||
refreshMy();
|
||||
}
|
||||
$rootScope.refresh();
|
||||
|
|
|
|||
Reference in a new issue