Fixed offline error indicator for homepage

This commit is contained in:
keannu125 2023-03-04 22:32:02 +08:00
parent 05c7804421
commit 16176aea9f

View file

@ -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}>