mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
WIP
This commit is contained in:
@@ -18,7 +18,7 @@ export function useHistoryReset(pageId: string) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setActiveHistoryId("");
|
setActiveHistoryId("");
|
||||||
setActiveHistoryPrevId("");
|
setActiveHistoryPrevId("");
|
||||||
// @ts-ignore - null is valid to clear the counts
|
// @ts-ignore
|
||||||
setDiffCounts(null);
|
setDiffCounts(null);
|
||||||
}, [pageId, setActiveHistoryId, setActiveHistoryPrevId, setDiffCounts]);
|
}, [pageId, setActiveHistoryId, setActiveHistoryPrevId, setDiffCounts]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ import {
|
|||||||
SpaceCaslSubject,
|
SpaceCaslSubject,
|
||||||
} from "@/features/space/permissions/permissions.type";
|
} from "@/features/space/permissions/permissions.type";
|
||||||
|
|
||||||
/**
|
|
||||||
* Manages history restore functionality including permission checking,
|
|
||||||
* confirmation modal, and the actual restore operation.
|
|
||||||
*/
|
|
||||||
export function useHistoryRestore() {
|
export function useHistoryRestore() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { IPageHistory } from "@/features/page-history/types/page.types";
|
|||||||
import { IPagination } from "@/lib/types.ts";
|
import { IPagination } from "@/lib/types.ts";
|
||||||
import { queryClient } from "@/main";
|
import { queryClient } from "@/main";
|
||||||
|
|
||||||
const HISTORY_STALE_TIME = 10 * 60 * 1000;
|
const HISTORY_STALE_TIME = 60 * 60 * 1000;
|
||||||
|
|
||||||
export function prefetchPageHistory(historyId: string) {
|
export function prefetchPageHistory(historyId: string) {
|
||||||
return queryClient.prefetchQuery({
|
return queryClient.prefetchQuery({
|
||||||
|
|||||||
Reference in New Issue
Block a user