[FIX] Content being hidden after logging in

Ensure overflow is only disabled when login page is showing
This commit is contained in:
2021-09-11 17:43:33 +01:00
parent c1b04b0736
commit efc58ff390
3 changed files with 17 additions and 2 deletions

13
src/RouteChangeTracker.js Normal file
View File

@@ -0,0 +1,13 @@
import { withRouter } from "react-router-dom";
export default withRouter(function RouteChangeTracker({ history, logEvent }) {
history.listen((location, action) => {
if (location.pathname === "/login") {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "auto";
}
});
return null;
})