Skip to content

Commit

Permalink
fix panel being shown in auth and loading states, when it should not
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Sep 13, 2023
1 parent 22d1800 commit 11fe6ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ export const Panel = ({ active, api }: PanelProps) => {
} = useProjectId();

// Render the Authentication flow if the user is not signed in.
if (!accessToken) return <Authentication key={PANEL_ID} setAccessToken={setAccessToken} />;
if (!accessToken)
return (
<Sections hidden={!active}>
<Authentication key={PANEL_ID} setAccessToken={setAccessToken} />
</Sections>
);

// Momentarily wait on addonState (should be very fast)
if (projectInfoLoading || !gitInfo) {
return <Spinner />;
return active ? <Spinner /> : null;
}

if (!projectId)
Expand Down

0 comments on commit 11fe6ff

Please sign in to comment.