@@ -42,7 +42,6 @@ const useIsEditorInit = (editor: IEditor) => {
4242 if ( ! editor ) return ;
4343
4444 const onInit = ( ) => {
45- console . log ( 'init: id' , editor . getLexicalEditor ( ) ?. _key ) ;
4645 setEditInit ( true ) ;
4746 } ;
4847 editor . on ( 'initialized' , onInit ) ;
@@ -103,13 +102,13 @@ interface DiffAllToolbarProps {
103102const DiffAllToolbar = memo < DiffAllToolbarProps > ( ( { documentId } ) => {
104103 const { t } = useTranslation ( 'editor' ) ;
105104 const isDarkMode = useIsDark ( ) ;
106- const [ editor , performSave , markDirty ] = useDocumentStore ( ( s ) => [
105+ const [ storeEditor , performSave , markDirty ] = useDocumentStore ( ( s ) => [
107106 s . editor ! ,
108107 s . performSave ,
109108 s . markDirty ,
110109 ] ) ;
111110
112- const hasPendingDiffs = useEditorHasPendingDiffs ( editor ) ;
111+ const hasPendingDiffs = useEditorHasPendingDiffs ( storeEditor ) ;
113112
114113 if ( ! hasPendingDiffs ) return null ;
115114
@@ -131,7 +130,7 @@ const DiffAllToolbar = memo<DiffAllToolbarProps>(({ documentId }) => {
131130 < Space >
132131 < Button
133132 onClick = { async ( ) => {
134- editor ?. dispatchCommand ( LITEXML_DIFFNODE_ALL_COMMAND , {
133+ storeEditor ?. dispatchCommand ( LITEXML_DIFFNODE_ALL_COMMAND , {
135134 action : DiffAction . Reject ,
136135 } ) ;
137136 await handleSave ( ) ;
@@ -145,7 +144,7 @@ const DiffAllToolbar = memo<DiffAllToolbarProps>(({ documentId }) => {
145144 < Button
146145 color = { 'default' }
147146 onClick = { async ( ) => {
148- editor ?. dispatchCommand ( LITEXML_DIFFNODE_ALL_COMMAND , {
147+ storeEditor ?. dispatchCommand ( LITEXML_DIFFNODE_ALL_COMMAND , {
149148 action : DiffAction . Accept ,
150149 } ) ;
151150 await handleSave ( ) ;
0 commit comments