Skip to content

Commit 453c180

Browse files
committed
[TOOL-2773] Fix incorrect caching in useCsvUpload hook
1 parent cfbe8c3 commit 453c180

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/dashboard/src/hooks/useCsvUpload.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ export function useCsvUpload<
134134
const { getRootProps, getInputProps, isDragActive } = useDropzone({
135135
onDrop,
136136
});
137+
137138
const normalizeQuery = useQueries({
138-
queries: rawData.map((o) => ({
139-
queryKey: ["snapshot-check-isAddress", o.address],
140-
queryFn: () => checkIsAddress({ item: o, thirdwebClient }),
139+
queries: rawData.map((item) => ({
140+
queryKey: ["snapshot-check-isAddress", item],
141+
queryFn: () => checkIsAddress({ item: item, thirdwebClient }),
141142
})),
142143
combine: (results) => {
143144
return {
@@ -149,6 +150,7 @@ export function useCsvUpload<
149150
};
150151
},
151152
});
153+
152154
const removeInvalid = useCallback(() => {
153155
const filteredData = normalizeQuery.data?.result.filter(
154156
({ isValid }) => isValid,

0 commit comments

Comments
 (0)