Pass abortSignal to sendToGroup
This commit is contained in:
parent
7afe3fcca2
commit
3be95e821e
6 changed files with 49 additions and 26 deletions
|
@ -89,6 +89,7 @@ export type SenderKeyTargetType = {
|
|||
};
|
||||
|
||||
export async function sendToGroup({
|
||||
abortSignal,
|
||||
contentHint,
|
||||
groupSendOptions,
|
||||
isPartialSend,
|
||||
|
@ -97,6 +98,7 @@ export async function sendToGroup({
|
|||
sendTarget,
|
||||
sendType,
|
||||
}: {
|
||||
abortSignal?: AbortSignal;
|
||||
contentHint: number;
|
||||
groupSendOptions: GroupSendOptionsType;
|
||||
isPartialSend?: boolean;
|
||||
|
@ -120,6 +122,12 @@ export async function sendToGroup({
|
|||
protoAttributes
|
||||
);
|
||||
|
||||
// Attachment upload might take too long to succeed - we don't want to proceed
|
||||
// with the send if the caller aborted this call.
|
||||
if (abortSignal?.aborted) {
|
||||
throw new Error('sendToGroup was aborted');
|
||||
}
|
||||
|
||||
return sendContentMessageToGroup({
|
||||
contentHint,
|
||||
contentMessage,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue