migrate to tanstack query v5

This commit is contained in:
reya
2023-10-28 07:35:39 +07:00
parent 42eb882f52
commit 555c8ec08a
51 changed files with 290 additions and 305 deletions
+2 -1
View File
@@ -17,6 +17,7 @@ export function LocalFilesWidget({ params }: { params: Widget }) {
const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } =
useInfiniteQuery({
queryKey: ['local-file-sharing'],
initialPageParam: 0,
queryFn: async ({ pageParam = 0 }) => {
return await db.getAllEventsByKinds([1063], 20, pageParam);
},
@@ -45,7 +46,7 @@ export function LocalFilesWidget({ params }: { params: Widget }) {
<WidgetWrapper>
<TitleBar id={params.id} title={params.title} />
<div className="flex-1">
{status === 'loading' ? (
{status === 'pending' ? (
<div className="flex h-full w-full items-center justify-center ">
<div className="inline-flex flex-col items-center justify-center gap-2">
<LoaderIcon className="h-5 w-5 animate-spin text-black dark:text-white" />