Skip to content

Commit becf8df

Browse files
committed
check
1 parent 684229c commit becf8df

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

app/routes/stats/npm/index.tsx

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
import * as React from 'react'
2-
import { createFileRoute, Link, useNavigate } from '@tanstack/react-router'
2+
import { createFileRoute, Link } from '@tanstack/react-router'
33
import { z } from 'zod'
44
import {
55
MdClose,
6-
MdStarBorder,
7-
MdStar,
86
MdLock,
97
MdLockOpen,
108
MdVisibility,
119
MdVisibilityOff,
1210
} from 'react-icons/md'
13-
import {
14-
keepPreviousData,
15-
queryOptions,
16-
useQueries,
17-
useQuery,
18-
useSuspenseQuery,
19-
} from '@tanstack/react-query'
11+
import { keepPreviousData, queryOptions, useQuery } from '@tanstack/react-query'
2012
import * as Plot from '@observablehq/plot'
2113
import { ParentSize } from '@visx/responsive'
2214
import { Tooltip } from '~/components/Tooltip'
@@ -425,14 +417,14 @@ export const Route = createFileRoute('/stats/npm/')({
425417
packageNames: search.packageNames,
426418
interval: search.interval,
427419
}),
428-
loader: async ({ context, deps }) => {
429-
await context.queryClient.ensureQueryData(
430-
npmQueryOptions({
431-
packageNames: deps.packageNames,
432-
interval: deps.interval,
433-
})
434-
)
435-
},
420+
// loader: async ({ context, deps }) => {
421+
// await context.queryClient.ensureQueryData(
422+
// npmQueryOptions({
423+
// packageNames: deps.packageNames,
424+
// interval: deps.interval,
425+
// })
426+
// )
427+
// },
436428
component: RouteComponent,
437429
})
438430

@@ -479,7 +471,7 @@ function RouteComponent() {
479471
})
480472
}
481473

482-
const npmQuery = useSuspenseQuery(
474+
const npmQuery = useQuery(
483475
npmQueryOptions({
484476
packageNames: packageNames || [],
485477
interval,
@@ -576,7 +568,7 @@ function RouteComponent() {
576568
})
577569
}
578570

579-
const validStats = npmQuery.data?.filter((data): data is NpmStats => {
571+
const validStats = (npmQuery.data ?? [])?.filter((data): data is NpmStats => {
580572
if (!data) return false
581573
return Array.isArray(data.downloads) && data.downloads.length > 0
582574
})
@@ -752,7 +744,7 @@ function RouteComponent() {
752744
</thead>
753745
<tbody className="bg-white dark:bg-gray-900">
754746
{npmQuery.data
755-
.map((stats) => {
747+
?.map((stats) => {
756748
if (!stats?.downloads?.length) return null
757749

758750
// Sort downloads by date

0 commit comments

Comments
 (0)