From 0c7c24d3d1e4580d6ce03f71b9381aa3f6b689cb Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 16 Jul 2020 10:18:18 +0300 Subject: make idempotency watch entire status --- src/components/post_status_form/post_status_form.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 29841261..c70c2232 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -208,14 +208,18 @@ const PostStatusForm = { }) }, watch: { - 'newStatus.contentType': function () { - this.autoPreview() - }, - 'newStatus.spoilerText': function () { - this.autoPreview() + 'newStatus': { + deep: true, + handler () { + this.statusChanged() + } } }, methods: { + statusChanged () { + this.autoPreview() + this.updateIdempotencyKey() + }, clearStatus () { const newStatus = this.newStatus this.newStatus = { @@ -239,7 +243,6 @@ const PostStatusForm = { el.style.height = 'auto' el.style.height = undefined this.error = null - this.updateIdempotencyKey() if (this.preview) this.previewStatus() }, async postStatus (event, newStatus, opts = {}) { @@ -407,7 +410,6 @@ const PostStatusForm = { } }, onEmojiInputInput (e) { - this.autoPreview() this.$nextTick(() => { this.resize(this.$refs['textarea']) }) -- cgit v1.2.3-70-g09d2