Skip to content

Commit 34946a1

Browse files
author
LasCC
committed
Update query 👀
1 parent b83f45a commit 34946a1

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/components/rss/cve.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ export default (props) => {
3232
);
3333
return res.json();
3434
};
35-
const { data, status, error, refetch } = useQuery("cve", fetchApi);
35+
const {
36+
isIdle,
37+
isLoading,
38+
isError,
39+
data,
40+
error,
41+
refetch,
42+
isFetching,
43+
} = useQuery("cve", fetchApi);
3644

3745
return (
3846
<QueueAnim delay={300} duration={1500}>
@@ -61,13 +69,14 @@ export default (props) => {
6169
onSubmit={() => refetch()}
6270
onSearch={() => refetch()}
6371
/>
64-
{status === "loading" && (
72+
{isIdle ? (
73+
"Not ready..."
74+
) : isLoading ? (
6575
<div style={{ textAlign: "center", marginTop: 25 }}>
6676
<Spin />
6777
<Empty />
6878
</div>
69-
)}
70-
{status === "error" && (
79+
) : isError ? (
7180
<>
7281
<Empty
7382
style={{ marginTop: 25 }}
@@ -89,8 +98,7 @@ export default (props) => {
8998
</Button>
9099
</Empty>
91100
</>
92-
)}
93-
{status === "success" && (
101+
) : (
94102
<>
95103
<div
96104
key='a'
@@ -180,6 +188,7 @@ export default (props) => {
180188
</List.Item>
181189
)}
182190
/>
191+
<div>{isFetching ? <Spin /> : null}</div>
183192
</div>
184193
</>
185194
)}

0 commit comments

Comments
 (0)