From 53cf6edd6a4fb8d3f68ac541122c485e8ca54df2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 30 Jul 2022 12:40:43 -0500 Subject: [PATCH] Update:Show prompt before marking item as finished that has progress #805 --- client/components/cards/LazyBookCard.vue | 16 +++++++++++++++- client/components/prompt/Confirm.vue | 2 +- .../tables/podcast/EpisodeTableRow.vue | 16 +++++++++++++++- client/components/widgets/MoreMenu.vue | 2 +- client/pages/item/_id/index.vue | 16 +++++++++++++++- 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 091f3b59..d4869df0 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -502,7 +502,21 @@ export default { } this.$emit('edit', this.libraryItem) }, - toggleFinished() { + toggleFinished(confirmed = false) { + if (!this.itemIsFinished && this.userProgressPercent > 0 && !confirmed) { + const payload = { + message: `Are you sure you want to mark "${this.displayTitle}" as finished?`, + callback: (confirmed) => { + if (confirmed) { + this.toggleFinished(true) + } + }, + type: 'yesNo' + } + this.store.commit('globals/setConfirmPrompt', payload) + return + } + var updatePayload = { isFinished: !this.itemIsFinished } diff --git a/client/components/prompt/Confirm.vue b/client/components/prompt/Confirm.vue index b5ef8296..9e15472e 100644 --- a/client/components/prompt/Confirm.vue +++ b/client/components/prompt/Confirm.vue @@ -1,7 +1,7 @@