Skip to content

Commit b3b7079

Browse files
authored
Merge pull request #8746 from ProcessMaker/bugfix/FOUR-29632
MSC - 401 errors after losing session when no action is selected in the warning message
2 parents 74d6fc2 + 44edd7b commit b3b7079

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

resources/js/common/sessionSync.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,16 @@ export const initSessionSync = ({
260260
const markActivity = (source) => {
261261
setSessionState(accountTimeoutLength);
262262
clearWarningState();
263+
setSuppressWarning(2000);
263264
broadcastSessionEvent("activity", { timeout: accountTimeoutLength, source });
264265
sessionDebugLog("activity", { source, timeout: accountTimeoutLength });
266+
const closeSessionModal = resolveCloseSessionModal();
267+
if (closeSessionModal) {
268+
closeSessionModal();
269+
}
265270
if (isLeader()) {
266271
ensureWorkerRunning(`activity:${source}`);
272+
startTimeoutWorker(sessionState.timeout);
267273
}
268274
};
269275

@@ -499,20 +505,6 @@ export const initSessionSync = ({
499505
broadcastSessionEvent("logout");
500506
});
501507

502-
// Restart the timeout worker (when the user interacts with the page)
503-
const eventsTimeoutWorker = ["click", "keypress"];
504-
eventsTimeoutWorker.forEach((event) => {
505-
document.addEventListener(event, () => {
506-
if (!isLeader()) {
507-
sessionDebugLog("worker:restart:skip", { event });
508-
return;
509-
}
510-
markActivity(event);
511-
sessionDebugLog("worker:restart", { event });
512-
AccountTimeoutWorker.postMessage({ method: "restart" });
513-
});
514-
});
515-
516508
const isSameDevice = (e) => {
517509
const localDeviceId = Vue.$cookies.get(e.device_variable);
518510
const remoteDeviceId = e.device_id;

0 commit comments

Comments
 (0)