From 683f9d9a289dbe616de67f3ecfc232e4148533f1 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 29 Nov 2023 16:15:31 +0530 Subject: [PATCH] fix: article meta does not show up on reload (#8415) Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../pages/articles/ArticleSettings.vue | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/articles/ArticleSettings.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/articles/ArticleSettings.vue index 6069b44b4..215c7c974 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/articles/ArticleSettings.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/articles/ArticleSettings.vue @@ -157,16 +157,23 @@ export default { return this.metaTags.map(item => item.name); }, }, + watch: { + article: { + handler() { + if (!isEmptyObject(this.article.meta || {})) { + const { + meta: { title = '', description = '', tags = [] }, + } = this.article; + this.metaTitle = title; + this.metaDescription = description; + this.metaTags = this.formattedTags({ tags }); + } + }, + deep: true, + immediate: true, + }, + }, mounted() { - if (!isEmptyObject(this.article.meta || {})) { - const { - meta: { title = '', description = '', tags = [] }, - } = this.article; - this.metaTitle = title; - this.metaDescription = description; - this.metaTags = this.formattedTags({ tags }); - } - this.saveArticle = debounce( () => { this.$emit('save-article', {