Skip to content

Commit

Permalink
[Odie] Disable handler while chat is either loading or sending (#95811)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllTerrainDeveloper authored Oct 29, 2024
1 parent 476bfac commit aed477d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const OdieSendMessageButton = ( {
const shouldBeDisabled = chatStatus === 'loading' || chatStatus === 'sending';

const sendMessageHandler = useCallback( async () => {
if ( inputRef.current?.value.trim() === '' ) {
if ( inputRef.current?.value.trim() === '' || shouldBeDisabled ) {
return;
}
const messageString = inputRef.current?.value;
Expand Down

0 comments on commit aed477d

Please sign in to comment.