From ea057c0473cb3bc411fadb9170c06e4b98f72030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 24 May 2023 11:33:40 +0100 Subject: [PATCH] fix: profile should wait for loaded state before rendering (#3855) Small change that makes it so that the profile page waits for the loaded state before rendering. E.g. Before this, there was a flash of the "change password" tab being visible for a very short time before the auth settings loaded. --- frontend/src/component/user/Profile/Profile.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/user/Profile/Profile.tsx b/frontend/src/component/user/Profile/Profile.tsx index 324d2aff7f..5073328bc6 100644 --- a/frontend/src/component/user/Profile/Profile.tsx +++ b/frontend/src/component/user/Profile/Profile.tsx @@ -13,7 +13,7 @@ export const Profile = () => { const { user } = useAuthUser(); const location = useLocation(); const navigate = useNavigate(); - const { config: simpleAuthConfig } = useAuthSettings('simple'); + const { config: simpleAuthConfig, loading } = useAuthSettings('simple'); const { uiConfig } = useUiConfig(); @@ -52,6 +52,8 @@ export const Profile = () => { setTab(tabFromUrl()); }, [location]); + if (loading) return null; + return (