settings: new option to disable event fetch from server side

This commit is contained in:
nemunaire 2019-01-19 08:04:10 +01:00
parent a4e0a90adf
commit 24989c4cfa
3 changed files with 18 additions and 1 deletions

View file

@ -162,8 +162,16 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
response.data.end = new Date(response.data.end);
response.data.generation = new Date(response.data.generation);
response.data.activateTime = new Date(response.data.activateTime);
if (response.data.activateTime <= new Date(Date.now() + (time.cu - time.he)))
if (response.data.activateTime <= new Date(Date.now() + (time.cu - time.he))) {
$rootScope.settings = response.data;
if (response.data.eventKindness && refreshEventsInterval) {
$interval.cancel(refreshEventsInterval);
refreshEventsInterval = null;
}
else if (!response.data.eventKindness && !refreshEventsInterval) {
refreshEvents();
}
}
else
$rootScope.settings.activateTime = response.data.activateTime;
});