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.
This commit is contained in:
Owen D'Aprile
2021-02-07 14:23:14 -05:00
parent cc909352b4
commit 73dddc13bd

View File

@@ -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";
});