mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 12:42:44 +01:00
13 lines
321 B
JavaScript
13 lines
321 B
JavaScript
|
const redirectIfOnLogin = () => {
|
||
|
const path = window.location.pathname;
|
||
|
if (path == "/login" || path == "/register") {
|
||
|
window.location.reload();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const observer = new MutationObserver((mutations) => {
|
||
|
redirectIfOnLogin();
|
||
|
});
|
||
|
observer.observe(document, { subtree: true, childList: true })
|
||
|
|
||
|
redirectIfOnLogin();
|