Update:Show prompt before marking item as finished that has progress #805

This commit is contained in:
advplyr 2022-07-30 12:40:43 -05:00
parent 92bedeac15
commit 53cf6edd6a
5 changed files with 47 additions and 5 deletions

View file

@ -124,7 +124,21 @@ export default {
})
}
},
toggleFinished() {
toggleFinished(confirmed = false) {
if (!this.userIsFinished && this.itemProgressPercent > 0 && !confirmed) {
const payload = {
message: `Are you sure you want to mark "${this.title}" as finished?`,
callback: (confirmed) => {
if (confirmed) {
this.toggleFinished(true)
}
},
type: 'yesNo'
}
this.$store.commit('globals/setConfirmPrompt', payload)
return
}
var updatePayload = {
isFinished: !this.userIsFinished
}