Stop autoplay on open

This commit is contained in:
Nick Mowen 2023-12-14 15:59:58 -07:00
parent 19ba92bbe3
commit 7ad7dafdab

View File

@ -33,10 +33,6 @@ function History() {
return ["timeline/hourly", { timezone, limit: API_LIMIT }]; return ["timeline/hourly", { timezone, limit: API_LIMIT }];
}, []); }, []);
const shouldAutoPlay = useMemo(() => {
return window.innerWidth < 480;
}, []);
const { const {
data: timelinePages, data: timelinePages,
size, size,
@ -51,11 +47,13 @@ function History() {
{ revalidateOnFocus: false } { revalidateOnFocus: false }
); );
const [detailLevel, _] = useState<"normal" | "extra" | "full">( const [detailLevel, _] = useState<"normal" | "extra" | "full">("normal");
"normal"
);
const [playback, setPlayback] = useState<Card | undefined>(); const [playback, setPlayback] = useState<Card | undefined>();
const shouldAutoPlay = useMemo(() => {
return playback == undefined && window.innerWidth < 480;
}, [playback]);
const timelineCards: CardsData | never[] = useMemo(() => { const timelineCards: CardsData | never[] = useMemo(() => {
if (!timelinePages) { if (!timelinePages) {
return []; return [];