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