fix page history generation

This commit is contained in:
Philipinho
2024-06-07 16:23:23 +01:00
parent 942917072b
commit 2afbede8ce
8 changed files with 122 additions and 99 deletions

View File

@ -4,13 +4,18 @@ import classes from "./history.module.css";
import { useAtom } from "jotai";
import { activeHistoryIdAtom } from "@/features/page-history/atoms/history-atoms";
import HistoryView from "@/features/page-history/components/history-view";
import { useEffect } from "react";
interface Props {
pageId: string;
}
export default function HistoryModalBody({ pageId }: Props) {
const [activeHistoryId] = useAtom(activeHistoryIdAtom);
const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom);
useEffect(() => {
setActiveHistoryId("");
}, [pageId]);
return (
<div className={classes.sidebarFlex}>

View File

@ -13,6 +13,7 @@ export function usePageHistoryListQuery(
queryKey: ["page-history-list", pageId],
queryFn: () => getPageHistoryList(pageId),
enabled: !!pageId,
gcTime: 0,
});
}