mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 13:12:35 +10:00
fix page history generation
This commit is contained in:
@ -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}>
|
||||
|
||||
@ -13,6 +13,7 @@ export function usePageHistoryListQuery(
|
||||
queryKey: ["page-history-list", pageId],
|
||||
queryFn: () => getPageHistoryList(pageId),
|
||||
enabled: !!pageId,
|
||||
gcTime: 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user