Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Jul 3, 2024
1 parent 996499a commit 3ba1ab7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion avUi/common-header-directive/common-header-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ angular

// helper function for enableLogoutCountdown()
function updateTimedown() {
if (scope.$parent.getSessionEndTime) {
scope.logoutTimeMs = scope.$parent.getSessionEndTime();
}

scope.showCountdown = true;
var now = Date.now();
scope.countdownSecs = Math.round((scope.logoutTimeMs - now) / 1000);
Expand Down Expand Up @@ -118,7 +122,11 @@ angular
election.presentation.booth_log_out__countdown_seconds :
ConfigService.authTokenExpirationSeconds
) * 1000;
scope.logoutTimeMs = initialTimeMs + ConfigService.authTokenExpirationSeconds * 1000;
if (scope.$parent.getSessionEndTime) {
scope.logoutTimeMs = scope.$parent.getSessionEndTime();
} else {
scope.logoutTimeMs = initialTimeMs + ConfigService.authTokenExpirationSeconds * 1000;
}
scope.countdownStartTimeMs = scope.logoutTimeMs - scope.elapsedCountdownMs;
scope.countdownPercent = calculateCountdownPercent();
updateProgressBar(scope.countdownPercent);
Expand Down
3 changes: 2 additions & 1 deletion dist/appCommon-v10.4.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
element && element.style.setProperty("width", percent);
}
function updateTimedown() {
scope.$parent.getSessionEndTime && (scope.logoutTimeMs = scope.$parent.getSessionEndTime()),
scope.showCountdown = !0;
var targetMins, targetNextTime, now = Date.now();
scope.countdownSecs = Math.round((scope.logoutTimeMs - now) / 1e3), scope.countdownMins = Math.round((scope.logoutTimeMs - now) / 6e4),
Expand All @@ -1217,7 +1218,7 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
ConfigService.authTokenExpirationSeconds && election && election.presentation && _.isNumber(election.presentation.booth_log_out__countdown_seconds) && (scope.showCountdown = !1,
scope.countdownSecs = 0, scope.countdownMins = 0, initialTimeMs = scope.$parent.getSessionStartTime && scope.$parent.getSessionStartTime() || Date.now(),
scope.elapsedCountdownMs = 1e3 * (0 < election.presentation.booth_log_out__countdown_seconds ? election.presentation.booth_log_out__countdown_seconds : ConfigService.authTokenExpirationSeconds),
scope.logoutTimeMs = initialTimeMs + 1e3 * ConfigService.authTokenExpirationSeconds,
scope.$parent.getSessionEndTime ? scope.logoutTimeMs = scope.$parent.getSessionEndTime() : scope.logoutTimeMs = initialTimeMs + 1e3 * ConfigService.authTokenExpirationSeconds,
scope.countdownStartTimeMs = scope.logoutTimeMs - scope.elapsedCountdownMs, scope.countdownPercent = calculateCountdownPercent(),
updateProgressBar(scope.countdownPercent), scope.isDemo || scope.isPreview || setTimeout(updateTimedown, 0 < election.presentation.booth_log_out__countdown_seconds ? scope.countdownStartTimeMs - Date.now() : 0)));
}, 0);
Expand Down

0 comments on commit 3ba1ab7

Please sign in to comment.