diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue index 050ccda06..be4f82e17 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue @@ -1,16 +1,13 @@ diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue index 6540b6460..cea89857b 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue @@ -53,7 +53,7 @@ const hasPendingChanges = computed( const localTitle = ref(effectiveTitle()); const localContent = ref(effectiveContent()); -const isDiffPanelOpen = ref(false); +const diffPanelRef = ref(null); // Autosave 500ms after the last edit. It sends both title and content so an // edit to one never drops a recent edit to the other. `stop` cancels a queued @@ -84,7 +84,7 @@ watch( [() => props.article?.id, hasPendingChanges], ([id, pending], [prevId, prevPending]) => { if ((id && id !== prevId) || (prevPending && !pending)) syncLocalState(); - if (prevPending && !pending) isDiffPanelOpen.value = false; + if (prevPending && !pending) diffPanelRef.value?.close(); } ); @@ -156,9 +156,9 @@ const handleCreateArticle = event => { :is-saving="isSaving" @go-back="onClickGoBack" @preview-article="previewArticle" - @show-diff="isDiffPanelOpen = !isDiffPanelOpen" + @show-diff="diffPanelRef?.open()" /> - +