Skip to content

Commit 310935d

Browse files
committed
Prevent flicker from 'sign in' to 'my account'
1 parent e57df8b commit 310935d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

dotcom-rendering/src/components/TopBarMyAccount.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ export const TopBarMyAccount = ({
262262
}: MyAccountProps) => {
263263
const { renderingTarget } = useConfig();
264264

265-
return (
266-
<>
267-
{authStatus.kind === 'SignedIn' ? (
265+
switch (authStatus.kind) {
266+
case 'SignedIn':
267+
return (
268268
<SignedInBraze
269269
mmaUrl={mmaUrl}
270270
idUrl={idUrl}
@@ -273,9 +273,10 @@ export const TopBarMyAccount = ({
273273
authStatus={authStatus}
274274
renderingTarget={renderingTarget}
275275
/>
276-
) : (
277-
<SignIn idUrl={idUrl} />
278-
)}
279-
</>
280-
);
276+
);
277+
case 'SignedOut':
278+
return <SignIn idUrl={idUrl} />;
279+
default:
280+
return null;
281+
}
281282
};

0 commit comments

Comments
 (0)