Skip to content

Commit d41ef17

Browse files
authored
trivial: don't do unnecessary racks fetch on inventory page (#2763)
don't do unnecessary racks fetch on inventory page
1 parent a5804f8 commit d41ef17

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

app/layouts/SystemLayout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export async function clientLoader() {
4242
.then(() => true)
4343
.catch(() => false)
4444

45-
// TODO: make sure 404 is the desired behavior. This situation should be
46-
// pretty unlikely.
4745
if (!isFleetViewer) throw trigger404
4846

4947
return null

app/pages/system/inventory/InventoryPage.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* Copyright Oxide Computer Company
77
*/
88

9-
import { getListQFn, queryClient, usePrefetchedQuery } from '@oxide/api'
109
import { Servers16Icon, Servers24Icon } from '@oxide/design-system/icons/react'
1110

1211
import { DocsPopover } from '~/components/DocsPopover'
@@ -16,21 +15,9 @@ import { PageHeader, PageTitle } from '~/ui/lib/PageHeader'
1615
import { docLinks } from '~/util/links'
1716
import { pb } from '~/util/path-builder'
1817

19-
const rackList = getListQFn('rackList', {})
20-
21-
export async function clientLoader() {
22-
await queryClient.prefetchQuery(rackList.optionsFn())
23-
return null
24-
}
25-
2618
export const handle = makeCrumb('Inventory', pb.sledInventory())
2719

2820
export default function InventoryPage() {
29-
const { data: racks } = usePrefetchedQuery(rackList.optionsFn())
30-
const rack = racks?.items[0]
31-
32-
if (!rack) return null
33-
3421
return (
3522
<>
3623
<PageHeader>

0 commit comments

Comments
 (0)