mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 00:41:10 +10:00
fix
This commit is contained in:
@ -4,7 +4,7 @@ import classes from './comment.module.css';
|
|||||||
import { useAtomValue } from 'jotai';
|
import { useAtomValue } from 'jotai';
|
||||||
import { timeAgo } from '@/lib/time';
|
import { timeAgo } from '@/lib/time';
|
||||||
import CommentEditor from '@/features/comment/components/comment-editor';
|
import CommentEditor from '@/features/comment/components/comment-editor';
|
||||||
import { editorAtoms } from '@/features/editor/atoms/editor-atoms';
|
import { pageEditorAtom } from '@/features/editor/atoms/page-editor-atom';
|
||||||
import CommentActions from '@/features/comment/components/comment-actions';
|
import CommentActions from '@/features/comment/components/comment-actions';
|
||||||
import CommentMenu from '@/features/comment/components/comment-menu';
|
import CommentMenu from '@/features/comment/components/comment-menu';
|
||||||
import { useHover } from '@mantine/hooks';
|
import { useHover } from '@mantine/hooks';
|
||||||
@ -22,7 +22,7 @@ function CommentListItem({ comment }: CommentListItemProps) {
|
|||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
const editor = useAtomValue(editorAtoms);
|
const editor = useAtomValue(pageEditorAtom);
|
||||||
const [content, setContent] = useState(comment.content);
|
const [content, setContent] = useState(comment.content);
|
||||||
const updateCommentMutation = useUpdateCommentMutation();
|
const updateCommentMutation = useUpdateCommentMutation();
|
||||||
const deleteCommentMutation = useDeleteCommentMutation(comment.pageId);
|
const deleteCommentMutation = useDeleteCommentMutation(comment.pageId);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { atom } from 'jotai';
|
import { atom } from 'jotai';
|
||||||
import { Editor } from '@tiptap/core';
|
import { Editor } from '@tiptap/core';
|
||||||
|
|
||||||
export const editorAtoms = atom<Editor | null>(null);
|
export const pageEditorAtom = atom<Editor | null>(null);
|
||||||
|
|
||||||
export const titleEditorAtom = atom<Editor | null>(null);
|
export const titleEditorAtom = atom<Editor | null>(null);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { useAtom } from 'jotai';
|
|||||||
import { authTokensAtom } from '@/features/auth/atoms/auth-tokens-atom';
|
import { authTokensAtom } from '@/features/auth/atoms/auth-tokens-atom';
|
||||||
import useCollaborationUrl from '@/features/editor/hooks/use-collaboration-url';
|
import useCollaborationUrl from '@/features/editor/hooks/use-collaboration-url';
|
||||||
import { currentUserAtom } from '@/features/user/atoms/current-user-atom';
|
import { currentUserAtom } from '@/features/user/atoms/current-user-atom';
|
||||||
import { editorAtoms } from '@/features/editor/atoms/editor-atoms';
|
import { pageEditorAtom } from '@/features/editor/atoms/page-editor-atom';
|
||||||
import { asideStateAtom } from '@/components/navbar/atoms/sidebar-atom';
|
import { asideStateAtom } from '@/components/navbar/atoms/sidebar-atom';
|
||||||
import { activeCommentIdAtom, showCommentPopupAtom } from '@/features/comment/atoms/comment-atom';
|
import { activeCommentIdAtom, showCommentPopupAtom } from '@/features/comment/atoms/comment-atom';
|
||||||
import CommentDialog from '@/features/comment/components/comment-dialog';
|
import CommentDialog from '@/features/comment/components/comment-dialog';
|
||||||
@ -34,7 +34,7 @@ export default function PageEditor({ pageId, editable = true }: PageEditorProps)
|
|||||||
const [token] = useAtom(authTokensAtom);
|
const [token] = useAtom(authTokensAtom);
|
||||||
const collaborationURL = useCollaborationUrl();
|
const collaborationURL = useCollaborationUrl();
|
||||||
const [currentUser] = useAtom(currentUserAtom);
|
const [currentUser] = useAtom(currentUserAtom);
|
||||||
const [, setEditor] = useAtom(editorAtoms);
|
const [, setEditor] = useAtom(pageEditorAtom);
|
||||||
const [, setAsideState] = useAtom(asideStateAtom);
|
const [, setAsideState] = useAtom(asideStateAtom);
|
||||||
|
|
||||||
const [, setActiveCommentId] = useAtom(activeCommentIdAtom);
|
const [, setActiveCommentId] = useAtom(activeCommentIdAtom);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { Heading } from '@tiptap/extension-heading';
|
|||||||
import { Text } from '@tiptap/extension-text';
|
import { Text } from '@tiptap/extension-text';
|
||||||
import { Placeholder } from '@tiptap/extension-placeholder';
|
import { Placeholder } from '@tiptap/extension-placeholder';
|
||||||
import { useAtomValue } from 'jotai';
|
import { useAtomValue } from 'jotai';
|
||||||
import { editorAtoms, titleEditorAtom } from '@/features/editor/atoms/editor-atoms';
|
import { pageEditorAtom, titleEditorAtom } from '@/features/editor/atoms/page-editor-atom';
|
||||||
import { useUpdatePageMutation } from '@/features/page/queries/page-query';
|
import { useUpdatePageMutation } from '@/features/page/queries/page-query';
|
||||||
import { useDebouncedValue } from '@mantine/hooks';
|
import { useDebouncedValue } from '@mantine/hooks';
|
||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
@ -22,7 +22,7 @@ export function TitleEditor({ pageId, title }: TitleEditorProps) {
|
|||||||
const [debouncedTitleState, setDebouncedTitleState] = useState('');
|
const [debouncedTitleState, setDebouncedTitleState] = useState('');
|
||||||
const [debouncedTitle] = useDebouncedValue(debouncedTitleState, 1000);
|
const [debouncedTitle] = useDebouncedValue(debouncedTitleState, 1000);
|
||||||
const updatePageMutation = useUpdatePageMutation();
|
const updatePageMutation = useUpdatePageMutation();
|
||||||
const pageEditor = useAtomValue(editorAtoms);
|
const pageEditor = useAtomValue(pageEditorAtom);
|
||||||
const [, setTitleEditor] = useAtom(titleEditorAtom);
|
const [, setTitleEditor] = useAtom(titleEditorAtom);
|
||||||
const [treeData, setTreeData] = useAtom(treeDataAtom);
|
const [treeData, setTreeData] = useAtom(treeDataAtom);
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { activeHistoryIdAtom, historyAtoms } from '@/features/page-history/atoms
|
|||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import { useCallback, useEffect } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
import { Button, ScrollArea, Group, Divider, Text } from '@mantine/core';
|
import { Button, ScrollArea, Group, Divider, Text } from '@mantine/core';
|
||||||
import { editorAtoms, titleEditorAtom } from '@/features/editor/atoms/editor-atoms';
|
import { pageEditorAtom, titleEditorAtom } from '@/features/editor/atoms/page-editor-atom';
|
||||||
import { modals } from '@mantine/modals';
|
import { modals } from '@mantine/modals';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ function HistoryList() {
|
|||||||
const { data, isLoading, isError } = usePageHistoryListQuery(pageId);
|
const { data, isLoading, isError } = usePageHistoryListQuery(pageId);
|
||||||
const { data: activeHistoryData } = usePageHistoryQuery(activeHistoryId);
|
const { data: activeHistoryData } = usePageHistoryQuery(activeHistoryId);
|
||||||
|
|
||||||
const [mainEditor] = useAtom(editorAtoms);
|
const [mainEditor] = useAtom(pageEditorAtom);
|
||||||
const [mainEditorTitle] = useAtom(titleEditorAtom);
|
const [mainEditorTitle] = useAtom(titleEditorAtom);
|
||||||
const [, setHistoryModalOpen] = useAtom(historyAtoms);
|
const [, setHistoryModalOpen] = useAtom(historyAtoms);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user