Skip to content

Commit

Permalink
chore:fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jeafreezy committed Nov 19, 2024
1 parent fe8553b commit 143defc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/components/ui/banner/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ const Banner = () => {
setIsBannerVisible(false);
};

if (!isBannerVisible || isError || data?.length === 0 || isLoading) {
return null;
}

const banner = useMemo(
() => (
<div className="w-full p-4 bg-primary flex items-center justify-between px-4 text-white">
Expand All @@ -40,7 +36,7 @@ const Banner = () => {
"flex flex-wrap gap-x-2 items-center justify-center w-full"
}
>
{data?.[0].message}
{data?.[0]?.message}
</Markdown>
<button onClick={handleCloseBanner} className="font-bold">
Expand All @@ -50,6 +46,10 @@ const Banner = () => {
[data],
);

if (!isBannerVisible || isError || data?.length === 0 || isLoading) {
return null;
}

return banner;
};

Expand Down

0 comments on commit 143defc

Please sign in to comment.