Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/web/src/pages/workspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,8 @@ function ReadyRoom({
setFiles((current) => [...current, ...fitting]);
};

const deliverFiles = async (): Promise<boolean> => {
const deliverFiles = async (text = value.trim()): Promise<boolean> => {
if (sending) return false;
const text = value.trim();
const attached = files;
setSending(true);
setSendFailed(false);
Expand Down Expand Up @@ -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,
Expand All @@ -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(""),
Comment on lines +1120 to +1122

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 · Removing a file during the decline does not stop it from uploading

Files are now uploaded only after the decline request finishes. Until then the attachment chips stay on screen, and their remove buttons do not appear to be disabled while sending. deliverFiles was created when the send started, so it uploads the file list from that moment. A file the person removes during the decline is still uploaded.

Open card, type text, attach two files, press send, then remove one file before the decline returns. Both files are uploaded.

Resolve this comment. Triage will not finish while it is open.

}),
});
};
const sendNow = () => {
Expand Down