Skip to content

Commit 3f252d3

Browse files
pfuto21454markharding
authored andcommitted
[#101] Feed Query Bug Fix
1 parent 043d21f commit 3f252d3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/polycentric/src/common/query/hooks/useQuery.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const useQueryStore = create<QueryStoreState>((set, get) => {
6969
status: QueryStatus.Loading,
7070
error: null,
7171
});
72+
7273
// Request from rs-core
7374
const observable = args.client.core.fetchQuery(
7475
args.queryKey,
@@ -81,7 +82,10 @@ export const useQueryStore = create<QueryStoreState>((set, get) => {
8182
updateQueryRef(key, { data: result.data, status: result.status });
8283
},
8384
error(message) {
84-
updateQueryRef(key, { error: message, status: QueryStatus.Error });
85+
console.warn(`useQuery[${key}] error: ${message}`);
86+
if (get().queries.get(key)?.status === QueryStatus.Error) {
87+
updateQueryRef(key, { error: message });
88+
}
8589
},
8690
complete() {
8791
// Terminal status already arrived via the final `next`.

0 commit comments

Comments
 (0)