From 3ea74af76d32f005eaed7df6bc9245e99f99ffd6 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Wed, 24 May 2023 19:29:54 +0200 Subject: [PATCH] Fix confirmation dialog By splitting the confirmation function into two halves, the closure was lost --- ui/media/js/main.js | 2 +- ui/media/js/utils.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index ecd8ad73..fa37600a 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -264,7 +264,7 @@ function shiftOrConfirm(e, prompt, fn) { confirm( 'Tip: To skip this dialog, use shift-click or disable the "Confirm dangerous actions" setting in the Settings tab.', prompt, - fn + () => { fn(e) } ) } } diff --git a/ui/media/js/utils.js b/ui/media/js/utils.js index 16778b2d..6ddb0ae6 100644 --- a/ui/media/js/utils.js +++ b/ui/media/js/utils.js @@ -918,9 +918,7 @@ function confirm(msg, title, fn) { animateFromElement: false, content: msg, buttons: { - yes: () => { - fn(e) - }, + yes: fn, cancel: () => {}, }, })