fix desc save bug

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2021-02-09 10:07:26 +01:00
committed by Julius Härtl
parent 418536ceb1
commit a34c3b0667
2 changed files with 5 additions and 4 deletions

View File

@@ -117,7 +117,7 @@
type="deck-card" /> type="deck-card" />
</div> </div>
<Description :key="card.id" :card="card" /> <Description :key="card.id" :card="card" @change="descriptionChanged" />
</div> </div>
</template> </template>
@@ -234,6 +234,9 @@ export default {
this.initialize() this.initialize()
}, },
methods: { methods: {
descriptionChanged(newDesc) {
this.copiedCard.description = newDesc
},
async initialize() { async initialize() {
if (!this.card) { if (!this.card) {
return return
@@ -253,9 +256,6 @@ export default {
} }
}, },
setDue() {
this.$store.dispatch('updateCardDue', this.copiedCard)
},
removeDue() { removeDue() {
this.copiedCard.duedate = null this.copiedCard.duedate = null
this.$store.dispatch('updateCardDue', this.copiedCard) this.$store.dispatch('updateCardDue', this.copiedCard)

View File

@@ -205,6 +205,7 @@ export default {
await this.$store.dispatch('updateCardDesc', { ...this.card, description: this.description }) await this.$store.dispatch('updateCardDesc', { ...this.card, description: this.description })
this.descriptionLastEdit = 0 this.descriptionLastEdit = 0
this.descriptionSaving = false this.descriptionSaving = false
this.$emit('change', this.description)
}, },
updateDescription() { updateDescription() {
this.descriptionLastEdit = Date.now() this.descriptionLastEdit = Date.now()