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,
|
error,
|
||||||
} = useQuery("notes", GetNotes, { retry: 0 });
|
} = useQuery("notes", GetNotes, { retry: 0 });
|
||||||
const logged_in = useSelector((state: LoginState) => state.Login.logged_in);
|
const logged_in = useSelector((state: LoginState) => state.Login.logged_in);
|
||||||
if (error) {
|
if (isLoading) {
|
||||||
return (
|
|
||||||
<div style={styles.note}>
|
|
||||||
<p style={styles.text_medium_red}>Error contacting Notes server</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else if (isLoading) {
|
|
||||||
return (
|
return (
|
||||||
<div style={styles.note}>
|
<div style={styles.note}>
|
||||||
<p style={styles.text_medium}>Loading Notes...</p>
|
<p style={styles.text_medium}>Loading Notes...</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
} else if (!logged_in && !error) {
|
||||||
if (!logged_in) {
|
|
||||||
return (
|
return (
|
||||||
<div style={styles.note}>
|
<div style={styles.note}>
|
||||||
<p style={styles.text_medium}>Please login to use Clip Notes</p>
|
<p style={styles.text_medium}>Please login to use Clip Notes</p>
|
||||||
</div>
|
</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) {
|
} else if (notes.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div style={styles.note}>
|
<div style={styles.note}>
|
||||||
|
|
Loading…
Reference in a new issue