From ba47710b4620532dcf2880ac08dd4e17d1d29dc9 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 11 Jan 2021 17:25:31 -0500 Subject: [PATCH] meme: add confirm to deletion button --- plugins/meme/web.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/meme/web.go b/plugins/meme/web.go index 60a5e76..32994f9 100644 --- a/plugins/meme/web.go +++ b/plugins/meme/web.go @@ -200,12 +200,14 @@ var memeIndex = ` evt.preventDefault(); evt.stopPropagation(); } - axios.delete('/meme/rm', { data: this.editConfig }) - .then(resp => { - this.editConfig = null; - this.refresh(); - }) - .catch(err => this.err = err); + if (confirm("Are you sure you want to delete this meme?")) { + axios.delete('/meme/rm', { data: this.editConfig }) + .then(resp => { + this.editConfig = null; + this.refresh(); + }) + .catch(err => this.err = err); + } } } })