diff --git a/src/shell/components/load-instance/index.js b/src/shell/components/load-instance/index.js index 7d175a21b5..c65b01fe74 100644 --- a/src/shell/components/load-instance/index.js +++ b/src/shell/components/load-instance/index.js @@ -33,11 +33,16 @@ export default connect((state) => { languages: state.languages, files: state.files, role: state.userRole.systemRole.name, + auth: state.auth, }; })( memo(function LoadInstance(props) { const [error, setError] = useState(""); useEffect(() => { + if (!props.auth.valid) { + return; + } + props.dispatch(fetchInstance()).then((res) => { if (res.status !== 200) { setError("You do not have permission to access this instance"); @@ -66,7 +71,7 @@ export default connect((state) => { props.dispatch(fetchFiles("views")); props.dispatch(fetchFiles("stylesheets")); props.dispatch(fetchFiles("scripts")); - }, []); + }, [props.auth]); useEffect(() => { if ( diff --git a/src/shell/components/private-route/index.js b/src/shell/components/private-route/index.js index 76dadd863d..f68c10b43e 100644 --- a/src/shell/components/private-route/index.js +++ b/src/shell/components/private-route/index.js @@ -6,7 +6,7 @@ import Login from "shell/components/login"; import { notify } from "shell/store/notifications"; import { verify } from "shell/store/auth"; import { Staging } from "../Staging"; -import { CircularProgress } from "@mui/material"; +import { CircularProgress, Backdrop } from "@mui/material"; export default connect((state) => { return { @@ -70,13 +70,18 @@ export default connect((state) => { }); return ( <> - {props.auth.valid ? ( - props.children - ) : ( + {props.children} + + theme.zIndex.tooltip + 10, // Needs to be on top of everything + }} + open={!props.auth.valid} + > {props.auth.checking ? : } - )} + ); })