From 16176aea9f8f90808896b5524bd8467d64b364a2 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 4 Mar 2023 22:32:02 +0800 Subject: [PATCH] Fixed offline error indicator for homepage --- src/Components/Notes/Notes.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Components/Notes/Notes.tsx b/src/Components/Notes/Notes.tsx index 2fd6689..bc3a4f5 100644 --- a/src/Components/Notes/Notes.tsx +++ b/src/Components/Notes/Notes.tsx @@ -16,25 +16,24 @@ export default function Notes() { error, } = useQuery("notes", GetNotes, { retry: 0 }); const logged_in = useSelector((state: LoginState) => state.Login.logged_in); - if (error) { - return ( -
-

Error contacting Notes server

-
- ); - } else if (isLoading) { + if (isLoading) { return (

Loading Notes...

); - } - if (!logged_in) { + } else if (!logged_in && !error) { return (

Please login to use Clip Notes

); + } else if (error) { + return ( +
+

Error contacting Notes server

+
+ ); } else if (notes.length === 0) { return (