From a4fcb3704a26ddc3a70adb0fb0956b5107052831 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Wed, 4 Nov 2026 18:23:49 -0800 Subject: [PATCH] fix(web): give a decline with files the typed words as its reason A send with files while an approval card was open declined it with no reason and sent the words with the files, so the coordinator was told the person left no feedback. The words now go as the decline's reason and the files follow on their own; a send with no words keeps the bare decline. --- apps/web/src/pages/workspace/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/workspace/index.tsx b/apps/web/src/pages/workspace/index.tsx index 05210787..e1b09f2c 100644 --- a/apps/web/src/pages/workspace/index.tsx +++ b/apps/web/src/pages/workspace/index.tsx @@ -850,9 +850,8 @@ function ReadyRoom({ setFiles((current) => [...current, ...fitting]); }; - const deliverFiles = async (): Promise => { + const deliverFiles = async (text = value.trim()): Promise => { if (sending) return false; - const text = value.trim(); const attached = files; setSending(true); setSendFailed(false); @@ -1106,6 +1105,7 @@ function ReadyRoom({ }; const sendFiles = async () => { if (sending) return false; + const text = value.trim(); const currentApprovals = await readPendingApprovals(); const currentOpen = currentApprovals?.find( (approval) => approval.packages === undefined, @@ -1114,6 +1114,13 @@ function ReadyRoom({ openApprovalId: currentOpen?.approvalId, decide: onDecideApproval, deliver: deliverFiles, + ...(text.length === 0 + ? {} + : { + decline: async (approvalId: string) => + (await deliverMail(text, true, declineWith(approvalId))) && + deliverFiles(""), + }), }); }; const sendNow = () => {