Skip to content

Commit 6c24e46

Browse files
authored
fix: collected messages array staying on preemt breaking chat (#1310)
1 parent 558ebd1 commit 6c24e46

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • packages/client/components/app/interface/channels/text

packages/client/components/app/interface/channels/text/Messages.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ export function Messages(props: Props) {
234234
}
235235

236236
// Cancel if we've been pre-empted
237-
if (preempted()) return;
237+
if (preempted()) {
238+
collectedMessages = undefined;
239+
return;
240+
}
238241

239242
// Assume we are not at the end if we jumped to a message
240243
// NB. we set this late to not display the "jump to bottom" bar
@@ -485,7 +488,10 @@ export function Messages(props: Props) {
485488
});
486489

487490
// Cancel if we've been pre-empted
488-
if (preempted()) return;
491+
if (preempted()) {
492+
collectedMessages = undefined;
493+
return;
494+
}
489495

490496
// Check if we're at the start of the conversation
491497
// NB. this may be counter-intuitive because we are in history but,

0 commit comments

Comments
 (0)