From 8c29d43befc1666b88dd9e934648d9496b2d51a9 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 30 May 2023 19:48:40 +0100 Subject: [PATCH] fix: page loading message does not persist --- src/components/PageProgress.tsx | 4 ++++ src/stores/page.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/PageProgress.tsx b/src/components/PageProgress.tsx index dcba3b744..6fe1654e5 100644 --- a/src/components/PageProgress.tsx +++ b/src/components/PageProgress.tsx @@ -14,6 +14,10 @@ export function PageProgress(props: Props) { const $pageProgressMessage = useStore(pageProgressMessage); useEffect(() => { + if ($pageProgressMessage === undefined) { + return; + } + setMessage($pageProgressMessage); }, [$pageProgressMessage]); diff --git a/src/stores/page.ts b/src/stores/page.ts index 187825095..137450ea2 100644 --- a/src/stores/page.ts +++ b/src/stores/page.ts @@ -1,4 +1,4 @@ import { atom } from 'nanostores'; -export const pageProgressMessage = atom(''); +export const pageProgressMessage = atom(undefined); export const sponsorHidden = atom(false);