From 40fc05b320b12d925f61c164063e9a5fedd7e8d5 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Thu, 11 Jan 2024 12:24:29 +0200 Subject: [PATCH] use main for counters --- .../CounterInfoService/components/EditorInfoTool.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wax-prosemirror-services/src/BottomInfoService/CounterInfoService/components/EditorInfoTool.js b/wax-prosemirror-services/src/BottomInfoService/CounterInfoService/components/EditorInfoTool.js index 6ef18f0c9..90cec8635 100644 --- a/wax-prosemirror-services/src/BottomInfoService/CounterInfoService/components/EditorInfoTool.js +++ b/wax-prosemirror-services/src/BottomInfoService/CounterInfoService/components/EditorInfoTool.js @@ -86,7 +86,10 @@ const Counter = styled.div` `; const EditorInfoTool = ({ view: { state }, item }) => { - const { activeView } = useContext(WaxContext); + const { + activeView, + pmViews: { main }, + } = useContext(WaxContext); const { t, i18n } = useTranslation(); const ref = useRef(); const [currentWordCount, setCurrentWordCount] = useState(0); @@ -102,9 +105,9 @@ const EditorInfoTool = ({ view: { state }, item }) => { }, [activeView.state.selection]); const infoDropDownOptions = () => { - const docText = activeView.state.doc.textBetween( + const docText = main.state.doc.textBetween( 0, - activeView.state.doc.content.size, + main.state.doc.content.size, undefined, ' ', ); -- GitLab