Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server,mobile): a message you send resumes a held queue, and mobile can resume one #21473

Mergedjuliusmarmingemerged 4 commits intomain fromt3code/queue-hold-releasemerged by juliusmarminge View on GitHub

Showing 9 changed files with 30 additions and 1 deletion (loading 6).

x
0 of 9 viewed, 9 left
26 additions and 0 deletionsapps/mobile/src/features/threads/ThreadComposer.tsxModified
View file
@@ -162,6 +162,8 @@
readonly onNativePasteText: (paste: ComposerTextPaste) => Promise<void>;
readonly onRemoveDraftImage: (imageId: string) => void;
readonly onStopThread: () => void;
+ /** Present while the thread's queue is held. */
+ readonly onResumeQueue: (() => Promise<void>) | null;
readonly onSendMessage: (followUp?: ActiveTurnComposerAction) => Promise<MessageId | null>;
readonly onShowUsageLimits: (report: UsageLimitsReport | null) => void;
readonly canSwitchProvider: boolean;
@@ -357,6 +359,16 @@
(queuedEdit?.existingAttachments.length ?? 0) > 0;
const stripAttachments = composerStripAttachments(draftAttachments);
const showStopAction = !hasContent && props.canStopThread && queuedEdit === null;
+ const onResumeQueue = props.onResumeQueue;
+ const [resumingQueue, setResumingQueue] = useState(false);
+ const showResumeAction =
+ !hasContent && !showStopAction && queuedEdit === null && onResumeQueue !== null;
+ const handleResumeQueue = async () => {
+ if (resumingQueue || onResumeQueue === null) return;
+ setResumingQueue(true);
+ await onResumeQueue();
+ setResumingQueue(false);
+ };
​
const uploadStates = useAtomValue(composerAttachmentUploadsAtom);
const attachmentsUploading =
@@ -955,6 +967,13 @@
disabled={!props.canOperateThread}