From ff9a4e396a6cc1ea3501fe327f6fed7e28c48e9c Mon Sep 17 00:00:00 2001 From: silverpill Date: Fri, 3 Jun 2022 13:10:32 +0000 Subject: [PATCH] Confirm before deleting post --- src/components/Post.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Post.vue b/src/components/Post.vue index 5d8acdf..370f219 100644 --- a/src/components/Post.vue +++ b/src/components/Post.vue @@ -426,9 +426,11 @@ export default class PostComponent extends Vue { } async deletePost() { - const authToken = this.store.ensureAuthToken() - await deletePost(authToken, this.post.id) - this.$emit("post-deleted") + if (confirm("Are you sure you want to delete this post?")) { + const authToken = this.store.ensureAuthToken() + await deletePost(authToken, this.post.id) + this.$emit("post-deleted") + } } getPaymentOptions(): PaymentOption[] {