From 6adddf87a1a2596cb14fc4faa44a49a150767981 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 10 Jan 2024 16:36:37 +0100 Subject: [PATCH] fix: add confirmation on deleting a subscription --- src/components/Sidebar/Item.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/Sidebar/Item.vue b/src/components/Sidebar/Item.vue index ced7c4e..36601ce 100644 --- a/src/components/Sidebar/Item.vue +++ b/src/components/Sidebar/Item.vue @@ -68,15 +68,17 @@ export default { }, methods: { async deleteSubscription() { - try { - this.loading = true - await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [], remove: [this.url] }) - } catch (e) { - console.error(e) - showError(t('repod', 'Error while removing the feed')) - } finally { - this.loading = false - this.$store.dispatch('subscriptions/fetch') + if (confirm(t('repod', 'Are you sure you want to delete this subscription?'))) { + try { + this.loading = true + await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [], remove: [this.url] }) + } catch (e) { + console.error(e) + showError(t('repod', 'Error while removing the feed')) + } finally { + this.loading = false + this.$store.dispatch('subscriptions/fetch') + } } }, },