From 770eb72aea5a2857e31bd5daae81b32c15e2aafd Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Tue, 26 Aug 2025 15:20:53 +0545 Subject: [PATCH] tryfix(OUT-2236): cannot read property of null (reading 'updateOuterDeco') possibly fixed --- lib/components/Tapwrite.tsx | 18 +----------------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/components/Tapwrite.tsx b/lib/components/Tapwrite.tsx index c22dfd2..2bc0089 100644 --- a/lib/components/Tapwrite.tsx +++ b/lib/components/Tapwrite.tsx @@ -27,7 +27,6 @@ import { TableCell } from './tiptap/table/table-cell' import { Box, IconButton, Stack } from '@mui/material' import Hardbreak from '@tiptap/extension-hard-break' import Placeholder from '@tiptap/extension-placeholder' -import { EditorState } from '@tiptap/pm/state' import { useAppState } from '../context/useAppState' import { AttachmentIcon } from '../icons' import { NotionLikeProps } from '../main' @@ -258,22 +257,7 @@ export const Editor = ({ useEffect(() => { if (editor && content !== editor.getHTML()) { - editor.commands.setContent(content) - - setTimeout(() => { - const { state, view } = editor - - // Create a new EditorState without undo/redo history - // This is necessary because a history is set after setContent command is run. So when cmd+z is operated, - // it ends up in an empty state. - const newState = EditorState.create({ - doc: state.doc, - plugins: state.plugins, // Preserve the plugins - }) - - // Replace the editor state with the new state (without history) - view.updateState(newState) - }, 0) + editor.commands.setContent(content, false) // no history entry } }, [content, editor]) diff --git a/package-lock.json b/package-lock.json index 6021c6d..50cf507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tapwrite", - "version": "1.1.93", + "version": "1.1.94", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tapwrite", - "version": "1.1.93", + "version": "1.1.94", "dependencies": { "re-resizable": "^6.10.0", "tippy.js": "^6.3.7" diff --git a/package.json b/package.json index b6d0e1d..604b6d5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tapwrite", "private": false, - "version": "1.1.93", + "version": "1.1.94", "type": "module", "main": "dist/main.js", "types": "dist/main.d.ts",