mirror of
https://github.com/docmost/docmost.git
synced 2026-08-26 00:07:04 +08:00
fix: local editor cache
This commit is contained in:
@@ -250,6 +250,17 @@ function CollabPageEditor({
|
|||||||
return [...mainExtensions, ...collabExtensions(provider, currentUser.user)];
|
return [...mainExtensions, ...collabExtensions(provider, currentUser.user)];
|
||||||
}, [provider, currentUser?.user]);
|
}, [provider, currentUser?.user]);
|
||||||
|
|
||||||
|
const debouncedUpdateContent = useDebouncedCallback((newContent: any) => {
|
||||||
|
const pageData = queryClient.getQueryData<IPage>(["pages", slugId]);
|
||||||
|
|
||||||
|
if (pageData) {
|
||||||
|
queryClient.setQueryData(["pages", slugId], {
|
||||||
|
...pageData,
|
||||||
|
content: newContent,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
const editor = useEditor(
|
const editor = useEditor(
|
||||||
{
|
{
|
||||||
extensions,
|
extensions,
|
||||||
@@ -364,17 +375,6 @@ function CollabPageEditor({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const debouncedUpdateContent = useDebouncedCallback((newContent: any) => {
|
|
||||||
const pageData = queryClient.getQueryData<IPage>(["pages", slugId]);
|
|
||||||
|
|
||||||
if (pageData) {
|
|
||||||
queryClient.setQueryData(["pages", slugId], {
|
|
||||||
...pageData,
|
|
||||||
content: newContent,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
const handleActiveCommentEvent = (event) => {
|
const handleActiveCommentEvent = (event) => {
|
||||||
const { commentId, resolved } = event.detail;
|
const { commentId, resolved } = event.detail;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user