mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): stop empty dictation from send
Co-authored-by: Kenny Lopez <klopez4212@gmail.com> Signed-off-by: John Tennant <jtennant@squareup.com>
This commit is contained in:
co-authored by
Kenny Lopez
parent
bb0f1fa95a
commit
3057890dd6
@@ -44,6 +44,7 @@ export function useMessageComposerDictation({
|
||||
|
||||
return {
|
||||
...dictation,
|
||||
canStopFromSend: isRecording || isStarting,
|
||||
prepareToSubmit,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -518,7 +518,6 @@ function MessageComposerImpl({
|
||||
// ── Submit message ──────────────────────────────────────────────────
|
||||
const submitMessage = React.useCallback(async () => {
|
||||
if (!prepareDictationSubmitRef.current()) return;
|
||||
|
||||
const trimmed = syncComposerContentFromEditor().trim();
|
||||
|
||||
// Edit mode
|
||||
@@ -838,13 +837,16 @@ function MessageComposerImpl({
|
||||
disabled ||
|
||||
media.isUploading ||
|
||||
mentionSendFlow.isPreparingMentionSend ||
|
||||
(isContentEmpty && media.pendingImeta.length === 0),
|
||||
(isContentEmpty &&
|
||||
media.pendingImeta.length === 0 &&
|
||||
!dictation.canStopFromSend),
|
||||
[
|
||||
disabled,
|
||||
media.isUploading,
|
||||
mentionSendFlow.isPreparingMentionSend,
|
||||
isContentEmpty,
|
||||
media.pendingImeta.length,
|
||||
dictation.canStopFromSend,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user