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:
parent
5ac575389e
commit
ea057c0473
@ -13,7 +13,7 @@ export const Profile = () => {
|
|||||||
const { user } = useAuthUser();
|
const { user } = useAuthUser();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { config: simpleAuthConfig } = useAuthSettings('simple');
|
const { config: simpleAuthConfig, loading } = useAuthSettings('simple');
|
||||||
|
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig } = useUiConfig();
|
||||||
|
|
||||||
@ -52,6 +52,8 @@ export const Profile = () => {
|
|||||||
setTab(tabFromUrl());
|
setTab(tabFromUrl());
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
|
if (loading) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VerticalTabs tabs={tabs} value={tab} onChange={onChange}>
|
<VerticalTabs tabs={tabs} value={tab} onChange={onChange}>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
Loading…
Reference in New Issue
Block a user