Clear the composer preview after sending a message. (#34116)

* Clear the composer preview after sending a message.

* fixup
This commit is contained in:
Will Hunt
2026-07-05 08:05:47 +00:00
committed by GitHub
parent a88b2e64c5
commit e994dbb419
3 changed files with 10 additions and 4 deletions
@@ -395,6 +395,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
};
private sendMessage = async (): Promise<void> => {
this.setState({ urlPreviewComposerContent: "" });
if (this.state.haveRecording && this.voiceRecordingButton.current) {
// There shouldn't be any text message to send when a voice recording is active, so
// just send out the voice recording.
@@ -34,7 +34,8 @@ export function MessageComposerUrlPreviewWrapper({ content }: { content: string
void vm.updateWithText(content);
},
[vm, content],
DEBOUNCE_REQUEST_TIMEOUT_MS,
// Update instantly if content is empty (e.g. sent message or cleared input)
content ? DEBOUNCE_REQUEST_TIMEOUT_MS : 0,
);
useEffect(() => {