mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2024-11-17 06:29:28 +08:00
Fixed offline error indicator for homepage
This commit is contained in:
parent
05c7804421
commit
16176aea9f
1 changed files with 8 additions and 9 deletions
|
@ -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 (
|
||||
<div style={styles.note}>
|
||||
<p style={styles.text_medium_red}>Error contacting Notes server</p>
|
||||
</div>
|
||||
);
|
||||
} else if (isLoading) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div style={styles.note}>
|
||||
<p style={styles.text_medium}>Loading Notes...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (!logged_in) {
|
||||
} else if (!logged_in && !error) {
|
||||
return (
|
||||
<div style={styles.note}>
|
||||
<p style={styles.text_medium}>Please login to use Clip Notes</p>
|
||||
</div>
|
||||
);
|
||||
} else if (error) {
|
||||
return (
|
||||
<div style={styles.note}>
|
||||
<p style={styles.text_medium_red}>Error contacting Notes server</p>
|
||||
</div>
|
||||
);
|
||||
} else if (notes.length === 0) {
|
||||
return (
|
||||
<div style={styles.note}>
|
||||
|
|
Loading…
Reference in a new issue