Skip to content

Commit

Permalink
Merge pull request #98 from chromaui/norbert/ap-3656-new-versions-of-…
Browse files Browse the repository at this point in the history
…the-addon-bleed-through-and-break-in-new

UI: Hide panel in auth and loading states
  • Loading branch information
ghengeveld committed Sep 14, 2023
2 parents 1f62347 + 11fe6ff commit a21b740
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 @@ -46,11 +46,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 a21b740

Please sign in to comment.