mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-30 05:17:49 +02:00
fix(site): handle missing default chart time (#2397)
Co-authored-by: henrygd <hank@henrygd.me>
This commit is contained in:
@@ -35,7 +35,7 @@ import { useToast } from "@/components/ui/use-toast"
|
||||
import { isReadOnlyUser } from "@/lib/api"
|
||||
import { pb } from "@/lib/api"
|
||||
import { SystemStatus } from "@/lib/enums"
|
||||
import { $allSystemsById, $direction, $userSettings } from "@/lib/stores"
|
||||
import { $allSystemsById, $direction, getUserChartTime } from "@/lib/stores"
|
||||
import {
|
||||
cn,
|
||||
isVisuallyLonger,
|
||||
@@ -503,7 +503,7 @@ function NetworkMonitorSheetContent({
|
||||
}) {
|
||||
// Keep monitor exploration independent of the system charts' time range.
|
||||
const [chartTimeStore] = useState(() => {
|
||||
const defaultTime = $userSettings.get().chartTime
|
||||
const defaultTime = getUserChartTime()
|
||||
return atom(defaultTime === "1m" ? "1h" : defaultTime)
|
||||
})
|
||||
const chartTime = useStore(chartTimeStore)
|
||||
|
||||
Reference in New Issue
Block a user