Skip to content

Commit d8a73ec

Browse files
authored
Merge pull request #7508 from nextcloud/fix/6680-adding-a-new-tag-to-a-card-has-unexpected-behaviour
fix: add new tags to card and board
2 parents 2ae965f + 802de6d commit d8a73ec

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/card/TagSelector.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export default {
7575
},
7676
methods: {
7777
onSelect(options) {
78-
const addedLabel = options.filter(option => !this.card.labels.includes(option))
78+
const addedLabel = options.filter(option => !this.card.labels.includes(option) && option.id && option.color)
79+
if (addedLabel.length === 0) {
80+
return
81+
}
7982
this.$emit('select', addedLabel[0])
8083
},
8184
onRemove(removedLabel) {

src/store/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ export default function storeFactory() {
492492
async addLabelToCurrentBoardAndCard({ dispatch, commit }, { newLabel, card }) {
493493
newLabel.boardId = this.state.currentBoard.id
494494
const label = await apiClient.createLabel(newLabel)
495+
card.labels.push(label)
495496
commit('addLabelToCurrentBoard', label)
496497
dispatch('addLabel', {
497498
card,

0 commit comments

Comments
 (0)