From c9021ab2d2c02f23ad5d9bcff3ccb0f5e283d914 Mon Sep 17 00:00:00 2001 From: Elitsa Date: Wed, 21 Aug 2024 14:44:09 +0200 Subject: [PATCH] Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made --- .../src/common/services/user.service.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js index 943141878a..bb56b7cc20 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js @@ -65,17 +65,17 @@ angular.module('umbraco.services') //countdown by 5 seconds since that is how long our timer is for. currentUser.remainingAuthSeconds -= 5; - //if there are more than 30 remaining seconds, recurse! - if (currentUser.remainingAuthSeconds > 30) { + //if there are more than 20 remaining seconds, recurse! + if (currentUser.remainingAuthSeconds > 20) { //we need to check when the last time the timeout was set from the server, if - // it has been more than 30 seconds then we'll manually go and retrieve it from the + // it has been more than 20 seconds then we'll manually go and retrieve it from the // server - this helps to keep our local countdown in check with the true timeout. if (lastServerTimeoutSet != null) { var now = new Date(); var seconds = (now.getTime() - lastServerTimeoutSet.getTime()) / 1000; - if (seconds > 30) { + if (seconds > 20) { //first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we // wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait. @@ -116,7 +116,7 @@ angular.module('umbraco.services') countdownUserTimeout(); } else { - //we've got less than 30 seconds remaining so let's check the server + //we've got less than 20 seconds remaining so let's check the server if (lastServerTimeoutSet != null) { //first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we