Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cratebay-gui/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ function Badge({
)
}

export { Badge, badgeVariants }
export { Badge }
2 changes: 1 addition & 1 deletion crates/cratebay-gui/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ function Button({
)
}

export { Button, buttonVariants }
export { Button }
2 changes: 1 addition & 1 deletion crates/cratebay-gui/src/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ function TabsContent({
)
}

export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
export { Tabs, TabsList, TabsTrigger, TabsContent }
17 changes: 12 additions & 5 deletions crates/cratebay-gui/src/hooks/useVolumes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,23 @@ export function useVolumes() {
} catch (e) {
if (reqId !== latestReqId.current) return
setError(String(e))
} finally {
if (reqId !== latestReqId.current) return
}
if (reqId === latestReqId.current) {
setLoading(false)
}
}, [])

useEffect(() => {
fetchVolumes()
const iv = setInterval(fetchVolumes, 5000)
return () => clearInterval(iv)
const initialFetch = setTimeout(() => {
void fetchVolumes()
}, 0)
const iv = setInterval(() => {
void fetchVolumes()
}, 5000)
return () => {
clearTimeout(initialFetch)
clearInterval(iv)
}
}, [fetchVolumes])

const createVolume = useCallback(async (name: string, driver: string) => {
Expand Down
Loading