Make battery history update when fetching telemetry

This commit is contained in:
Gnome Adrift
2026-03-30 10:07:20 -07:00
committed by Jack Kingsman
parent 78b5598f67
commit 0511d6f69b
2 changed files with 4 additions and 1 deletions

View File

@@ -318,6 +318,7 @@ export function RepeaterDashboard({
publicKey={conversation.id}
isTracked={telemetryTracked}
onToggleTracking={handleToggleTelemetryTracking}
statusFetchedAt={paneStates.status.fetched_at}
/>
<RadioSettingsPane
data={paneData.radioSettings}

View File

@@ -17,10 +17,12 @@ export function BatteryHistoryPane({
publicKey,
isTracked,
onToggleTracking,
statusFetchedAt,
}: {
publicKey: string;
isTracked: boolean;
onToggleTracking: () => void;
statusFetchedAt?: number | null;
}) {
const chartRef = useRef<HTMLDivElement>(null);
const uplotRef = useRef<uPlot | null>(null);
@@ -47,7 +49,7 @@ export function BatteryHistoryPane({
useEffect(() => {
fetchHistory(range);
}, [fetchHistory, range]);
}, [fetchHistory, range, statusFetchedAt]);
// Build / rebuild chart
useEffect(() => {