File tree Expand file tree Collapse file tree
app/dashboard/diagrams/text/[id] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,12 +131,6 @@ export default function TextDiagramEditorPage() {
131131 } ) ( )
132132 } , [ diagramId , router ] )
133133
134- useEffect ( ( ) => {
135- if ( isPreviewMode && textContent && previewRef . current ) {
136- void renderDiagram ( )
137- }
138- } , [ isPreviewMode , textContent , renderDiagram ] )
139-
140134 const renderDiagram = useCallback ( async ( ) => {
141135 if ( ! previewRef . current || ! textContent ) return
142136
@@ -154,6 +148,12 @@ export default function TextDiagramEditorPage() {
154148 }
155149 } , [ textContent ] )
156150
151+ useEffect ( ( ) => {
152+ if ( isPreviewMode && textContent && previewRef . current ) {
153+ void renderDiagram ( )
154+ }
155+ } , [ isPreviewMode , textContent , renderDiagram ] )
156+
157157 const handleSave = async ( ) => {
158158 if ( ! diagram ) return
159159 await updateDiagram ( diagram . id , {
You can’t perform that action at this time.
0 commit comments