Skip to content

Commit

Permalink
fix: marketplace offline note flashing (#327)
Browse files Browse the repository at this point in the history
## Motivation

<!-- List motivation and changes here -->

## Issues closed

<!-- List closed issues here -->
  • Loading branch information
pixelass authored May 28, 2024
1 parent 2579bfd commit 46316bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client/pages/[locale]/core/marketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ function ErrorMessage({ error }: { error: string }) {

export default function Page(_properties: InferGetStaticPropsType<typeof getStaticProps>) {
const { t } = useTranslation(["common", "labels"]);
const [errorMessage, setErrorMessage] = useState<string | undefined | null>(null);

const connected = useOnlineStatus();

Expand All @@ -218,7 +219,9 @@ export default function Page(_properties: InferGetStaticPropsType<typeof getStat
revalidateOnFocus: true,
}
);
const errorMessage = connected ? error?.message : t("texts:notConnectedToTheInternet");
useEffect(() => {
setErrorMessage(connected ? error?.message : t("texts:notConnectedToTheInternet"));
}, [connected, error, t]);

return (
<>
Expand Down

0 comments on commit 46316bd

Please sign in to comment.