Fix filtering and sorting of stacks that caused card reordering to only apply after reload

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-04-09 11:06:19 +02:00
parent fd82f4c792
commit 929ef69d31
2 changed files with 13 additions and 7 deletions

View File

@@ -77,7 +77,7 @@
:drag-handle-selector="dragHandleSelector"
@should-accept-drop="canEdit"
@drop="($event) => onDropCard(stack.id, $event)">
<Draggable v-for="card in cardsByStack(stack.id)" :key="card.id">
<Draggable v-for="card in cardsByStack" :key="card.id">
<CardItem v-if="card" :id="card.id" />
</Draggable>
</Container>
@@ -122,7 +122,7 @@ export default {
'canEdit',
]),
cardsByStack() {
return (id) => this.$store.getters.cardsByStack(id)
return this.$store.getters.cardsByStack(this.stack.id)
},
dragHandleSelector() {
return this.canEdit ? null : '.no-drag'
@@ -150,7 +150,7 @@ export default {
},
payloadForCard(stackId) {
return index => {
return this.cardsByStack(stackId)[index]
return this.cardsByStack[index]
}
},
deleteStack(stack) {