Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: word count is 0 when note is first opened

thecodrrc1fd1b6d29bb
diff --git a/apps/web/src/components/editor/tinymce.js b/apps/web/src/components/editor/tinymce.js
index e927eb386..adf59e129 100644
--- a/apps/web/src/components/editor/tinymce.js
+++ b/apps/web/src/components/editor/tinymce.js
@@ -242,12 +242,13 @@ function TinyMCE(props) {
});
const onEditorChange = debounce(() => {
+ if (onWordCountChanged) onWordCountChanged(editor.countWords());
+
if (!editor.getHTML) return;
if (editor.isLoading) {
editor.isLoading = false;
return;
}
- onWordCountChanged(editor.countWords());
editor.getHTML().then((html) => {
onChange(html, editor);
});