diff --git a/src/components/cards/CardMenu.vue b/src/components/cards/CardMenu.vue index 5b471ea86..4df722601 100644 --- a/src/components/cards/CardMenu.vue +++ b/src/components/cards/CardMenu.vue @@ -167,10 +167,14 @@ export default { }, }) }, - moveCard() { + async moveCard() { this.copiedCard = Object.assign({}, this.card) + const boardId = this.card?.boardId ? this.card.boardId : this.$route.params.id this.copiedCard.stackId = this.selectedStack.id this.$store.dispatch('moveCard', this.copiedCard) + if (parseInt(boardId) === parseInt(this.selectedStack.boardId)) { + await this.$store.commit('addNewCard', { ...this.copiedCard }) + } this.modalShow = false }, async loadStacksFromBoard(board) { diff --git a/src/store/card.js b/src/store/card.js index 30c54b52d..6dbea6112 100644 --- a/src/store/card.js +++ b/src/store/card.js @@ -264,6 +264,9 @@ export default { Vue.set(state.cards[existingIndex], 'attachmentCount', state.cards[existingIndex].attachmentCount - 1) } }, + addNewCard(state, card) { + state.cards.push(card) + }, }, actions: { async addCard({ commit }, card) {