From 35ff1054f4accfa9f7157fc3c90c08a9e15844d7 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Fri, 16 Jan 2026 12:08:40 +0100 Subject: [PATCH] feat(common): add onCancel callback in the confirmation modal --- app/components/Common/ConfirmationModal.vue | 1 + app/stores/confirmationModal.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/components/Common/ConfirmationModal.vue b/app/components/Common/ConfirmationModal.vue index 18944d2..22ff8c9 100644 --- a/app/components/Common/ConfirmationModal.vue +++ b/app/components/Common/ConfirmationModal.vue @@ -22,6 +22,7 @@ const handleActivateA = () => { }; const handleActivateB = () => { + confirmationModal.onCancel?.(); confirmationModal.close(); }; diff --git a/app/stores/confirmationModal.ts b/app/stores/confirmationModal.ts index fb69ae6..acc97c7 100644 --- a/app/stores/confirmationModal.ts +++ b/app/stores/confirmationModal.ts @@ -11,6 +11,7 @@ export const useConfirmationModal = defineStore("confirmationModal", { text: "", onConfirm: null as (() => void) | null, onClosed: null as (() => void) | null, + onCancel: null as (() => void) | null, offsetY: MODAL_MAX_Y_OFFSET, buttonsYOffset: 0, modalButtonsYOffset: BUTTONS_MAX_Y_OFFSET, @@ -21,12 +22,14 @@ export const useConfirmationModal = defineStore("confirmationModal", { actions: { open(options: { text: string; + onCancel?: () => void; onConfirm?: () => void; onClosed?: () => void; }) { gsap.killTweensOf(this); this.text = options.text; this.onConfirm = options.onConfirm ?? null; + this.onCancel = options.onCancel ?? null; this.onClosed = options.onClosed ?? null; this.isVisible = true; this.isClosing = false;