From 536e77cdaacb5bc58c66c6f8afff6928577092aa Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 13 Nov 2020 01:32:00 +0300 Subject: [PATCH] Fix editor inputs --- src/views/settings/components/Instance.vue | 5 ++++- src/views/settings/components/Other.vue | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index 5e016d1a..e3dacea2 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -181,7 +181,10 @@ export default { async onSubmit() { try { await this.$store.dispatch('SubmitChanges') - await this.$store.dispatch('UpdateInstanceDocs', { name: 'instance-panel', content: this.editorContent }) + await this.$store.dispatch('UpdateInstanceDocs', { + name: 'instance-panel', + content: this.editorContent.length > 0 ? this.editorContent : this.instancePanelContent + }) } catch (e) { return } diff --git a/src/views/settings/components/Other.vue b/src/views/settings/components/Other.vue index 925fef81..0a697138 100644 --- a/src/views/settings/components/Other.vue +++ b/src/views/settings/components/Other.vue @@ -114,12 +114,15 @@ export default { }, methods: { handleEditorUpdate(content) { - this.editorContent = content + this.termsOfServices = content }, async onSubmit() { try { await this.$store.dispatch('SubmitChanges') - await this.$store.dispatch('UpdateInstanceDocs', { name: 'terms-of-service', content: this.editorContent }) + await this.$store.dispatch('UpdateInstanceDocs', { + name: 'terms-of-service', + content: this.termsOfServices.length > 0 ? this.termsOfServices : this.termsOfServicesContent + }) } catch (e) { return }