center the multi-camera export time range on the current playback position

This commit is contained in:
Josh Hawkins 2026-07-18 06:49:18 -05:00
parent fddcdcab2c
commit eb32668431

View File

@ -444,10 +444,10 @@ export function ExportContent({
} }
setRange({ setRange({
before: latestTime, before: currentTime + 1800,
after: latestTime - 3600, after: currentTime - 1800,
}); });
}, [activeTab, latestTime, range, setRange]); }, [activeTab, currentTime, range, setRange]);
const { data: events, isLoading: isEventsLoading } = useSWR<Event[]>( const { data: events, isLoading: isEventsLoading } = useSWR<Event[]>(
activeTab === "multi" && debouncedRange activeTab === "multi" && debouncedRange
@ -817,7 +817,19 @@ export function ExportContent({
<Tabs <Tabs
value={activeTab} value={activeTab}
onValueChange={(value) => setActiveTab(value as ExportTab)} onValueChange={(value) => {
const tab = value as ExportTab;
if (tab === "multi") {
setRange({
before: currentTime + 1800,
after: currentTime - 1800,
});
} else {
onSelectTime(selectedOption);
}
setActiveTab(tab);
}}
className={cn("w-full", !isDesktop && "flex min-h-0 flex-1 flex-col")} className={cn("w-full", !isDesktop && "flex min-h-0 flex-1 flex-col")}
> >
<TabsList className="grid w-full grid-cols-2"> <TabsList className="grid w-full grid-cols-2">