diff --git a/webapp/components/ContributionForm/index.vue b/webapp/components/ContributionForm/index.vue index 203c0963f..62c3650c8 100644 --- a/webapp/components/ContributionForm/index.vue +++ b/webapp/components/ContributionForm/index.vue @@ -15,7 +15,7 @@ model="language" :options="form.languageOptions" icon="globe" - :placeholder="form.placeholder" + :placeholder="locale" :label="$t('contribution.languageSelectLabel')" /> @@ -65,7 +65,6 @@ export default { content: '', language: null, languageOptions: [], - placeholder: '', }, formSchema: { title: { required: true, min: 3, max: 64 }, @@ -90,15 +89,15 @@ export default { this.form.content = contribution.content this.form.title = contribution.title this.form.language = this.locale - this.form.placeholder = this.locale }, }, }, computed: { locale() { - const locale = this.contribution.language - ? locales.find(loc => this.contribution.language === loc.code) - : locales.find(loc => this.$i18n.locale() === loc.code) + const locale = + this.contribution && this.contribution.language + ? locales.find(loc => this.contribution.language === loc.code) + : locales.find(loc => this.$i18n.locale() === loc.code) return locale.name }, }, diff --git a/webapp/components/Editor/index.vue b/webapp/components/Editor/index.vue index 59aa73cb2..0690b15bd 100644 --- a/webapp/components/Editor/index.vue +++ b/webapp/components/Editor/index.vue @@ -323,6 +323,7 @@ export default { }) }, beforeDestroy() { + this.$root.$off('changeLanguage') this.editor.destroy() }, methods: { diff --git a/webapp/components/comments/CommentList/index.vue b/webapp/components/comments/CommentList/index.vue index d127bab47..c70c00c85 100644 --- a/webapp/components/comments/CommentList/index.vue +++ b/webapp/components/comments/CommentList/index.vue @@ -54,6 +54,9 @@ export default { this.refetchPostComments() }) }, + beforeDestroy() { + this.$root.$off('refetchPostComments') + }, methods: { refetchPostComments() { if (this.$apollo.queries.Post) {