From 1b54bf553d3e9235d9a2807ba2c9b3b1122d6528 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Tue, 26 Nov 2024 13:40:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=95=A8=EC=88=98=20=EC=A0=84=EB=8B=AC=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #193 --- client/src/features/editor/Editor.tsx | 12 +++--------- client/src/features/workSpace/WorkSpace.tsx | 2 -- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/client/src/features/editor/Editor.tsx b/client/src/features/editor/Editor.tsx index 521e6c7e..aec09c34 100644 --- a/client/src/features/editor/Editor.tsx +++ b/client/src/features/editor/Editor.tsx @@ -35,7 +35,6 @@ interface EditorProps { onTitleChange: (title: string) => void; pageId: string; serializedEditorData: serializedEditorDataProps; - updatePageData: (pageId: string, newData: serializedEditorDataProps) => void; } interface ClipboardMetadata { value: string; @@ -43,12 +42,7 @@ interface ClipboardMetadata { color: TextColorType | undefined; backgroundColor: BackgroundColorType | undefined; } -export const Editor = ({ - onTitleChange, - pageId, - serializedEditorData, - updatePageData, -}: EditorProps) => { +export const Editor = ({ onTitleChange, pageId, serializedEditorData }: EditorProps) => { const { sendCharInsertOperation, sendCharDeleteOperation, @@ -194,7 +188,7 @@ export const Editor = ({ linkedList: editorCRDT.current.LinkedList, }); }, - [sendCharInsertOperation, sendCharDeleteOperation, editorCRDT, pageId, updatePageData], + [sendCharInsertOperation, sendCharDeleteOperation, editorCRDT, pageId], ); const handleKeyDown = ( @@ -356,7 +350,7 @@ export const Editor = ({ block.crdt.currentCaret = caretPosition; }, - [editorCRDT, pageId, sendCharInsertOperation, updatePageData], + [editorCRDT, pageId, sendCharInsertOperation], ); const subscriptionRef = useRef(false); diff --git a/client/src/features/workSpace/WorkSpace.tsx b/client/src/features/workSpace/WorkSpace.tsx index 97c32792..2456efd5 100644 --- a/client/src/features/workSpace/WorkSpace.tsx +++ b/client/src/features/workSpace/WorkSpace.tsx @@ -23,7 +23,6 @@ export const WorkSpace = () => { updatePageTitle, initPages, initPagePosition, - updatePageData, openPage, } = usePagesManage(workspace, clientId); const visiblePages = pages.filter((page) => page.isVisible); @@ -69,7 +68,6 @@ export const WorkSpace = () => { handlePageSelect={selectPage} handlePageClose={closePage} handleTitleChange={updatePageTitle} - updatePageData={updatePageData} /> ) : null, )}