1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

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.
This commit is contained in:
Nuno Góis 2023-05-24 11:33:40 +01:00 committed by GitHub
parent 5ac575389e
commit ea057c0473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 (
<VerticalTabs tabs={tabs} value={tab} onChange={onChange}>
<ConditionallyRender