fix custom seo meta (#408)

This commit is contained in:
Chirag Chhatrala 2024-05-13 16:54:41 +05:30 committed by GitHub
parent 34f92a6f34
commit b4a5843de6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 14 deletions

View File

@ -77,21 +77,13 @@ export default {
return { return {
workspacesStore: useWorkspacesStore(), workspacesStore: useWorkspacesStore(),
workingFormStore, workingFormStore,
form: storeToRefs(workingFormStore).content,
} }
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
form: {
get() {
return this.workingFormStore.content
},
/* We add a setter */
set(value) {
this.workingFormStore.set(value)
},
},
workspace() { workspace() {
return this.workspacesStore.getCurrent return this.workspacesStore.getCurrent
}, },
@ -111,6 +103,9 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
if (!this.form.seo_meta || Array.isArray(this.form.seo_meta))
this.form.seo_meta = {};
["page_title", "page_description", "page_thumbnail", "page_favicon"].forEach((keyname) => { ["page_title", "page_description", "page_thumbnail", "page_favicon"].forEach((keyname) => {
if (this.form.seo_meta[keyname] === undefined) { if (this.form.seo_meta[keyname] === undefined) {
this.form.seo_meta[keyname] = null this.form.seo_meta[keyname] = null