From 73dddc13bd57ca850d553976b61c6abdeede624f Mon Sep 17 00:00:00 2001 From: Owen D'Aprile Date: Sun, 7 Feb 2021 14:23:14 -0500 Subject: Disable page leave warning on unexpected logout When already logged in, and an unexpected logout occurs, disable the page leave warning to prevent the unnecessary popup. --- web/share/js/kvm/session.js | 1 + 1 file changed, 1 insertion(+) (limited to 'web/share/js') diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index 8f340c27..2e4c4f6d 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -190,6 +190,7 @@ export function Session() { __ws.onerror = __wsErrorHandler; __ws.onclose = __wsCloseHandler; } else if (http.status === 401 || http.status === 403) { + window.onbeforeunload = () => null; wm.error("Unexpected logout occured, please login again").then(function() { document.location.href = "/login"; }); -- cgit v1.2.3