diff --git a/changelog.d/mention-twice.fix b/changelog.d/mention-twice.fix new file mode 100644 index 0000000000000000000000000000000000000000..0e4b71dfd4ac625fc595468b6b0c5b1f981d2593 --- /dev/null +++ b/changelog.d/mention-twice.fix @@ -0,0 +1 @@ +Fix a bug where mentioning a user twice will not fill the mention into the textarea diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index b44354db1957d913ffda5b01678a84ba1b493e26..8970dd9bce7d147d451a31f917ab9ee84b4e2e82 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -44,6 +44,10 @@ const PostStatusModal = { methods: { closeModal () { this.$store.dispatch('closePostStatusModal') + }, + resetAndClose () { + this.$store.dispatch('resetPostStatusModal') + this.$store.dispatch('closePostStatusModal') } } } diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue index dbcd321eb4bc8a14532f51b6666826be44cba552..bc2cad4a10c260204132ff3007caca9f419961b8 100644 --- a/src/components/post_status_modal/post_status_modal.vue +++ b/src/components/post_status_modal/post_status_modal.vue @@ -12,7 +12,7 @@ <PostStatusForm class="panel-body" v-bind="params" - @posted="closeModal" + @posted="resetAndClose" /> </div> </Modal> diff --git a/src/modules/postStatus.js b/src/modules/postStatus.js index 638c1fb2028d25b959762ce4d8272e7cdbf15042..d3bea13784daf6bc3e9248cea9447ff72e3cfb71 100644 --- a/src/modules/postStatus.js +++ b/src/modules/postStatus.js @@ -10,6 +10,9 @@ const postStatus = { }, closePostStatusModal (state) { state.modalActivated = false + }, + resetPostStatusModal (state) { + state.params = null } }, actions: { @@ -18,6 +21,9 @@ const postStatus = { }, closePostStatusModal ({ commit }) { commit('closePostStatusModal') + }, + resetPostStatusModal ({ commit }) { + commit('resetPostStatusModal') } } }