Skip to content

Commit

Permalink
fix crash on databse panel
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Oct 29, 2023
1 parent febf9ee commit 54c27c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/panels/database/DatabasePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,17 @@ function PanelWithError(props: {
children: React.ReactNode;
}) {
const referenceDatabase = useAtomValue(referenceDbAtom);
let children = props.children;
if (props.type === "local" && !referenceDatabase) {
props.children = <NoDatabaseWarning />;
children = <NoDatabaseWarning />;
}
if (props.error && props.type !== "local") {
props.children = <Alert color="red">{props.error.toString()}</Alert>;
children = <Alert color="red">{props.error.toString()}</Alert>;
}

return (
<Tabs.Panel pt="xs" mr="xs" value={props.value}>
{props.children}
{children}
</Tabs.Panel>
);
}
Expand Down

0 comments on commit 54c27c0

Please sign in to comment.