diff --git a/package.json b/package.json index 9259c8466d..e2f613ac94 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "emoji-mart": "^5.4.0", "react": "^19.0.0 || ^18.0.0 || ^17.0.0", "react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0", - "stream-chat": "^9.35.0" + "stream-chat": "^9.37.0" }, "peerDependenciesMeta": { "@breezystack/lamejs": { @@ -212,7 +212,7 @@ "react-dom": "^19.0.0", "sass": "^1.97.2", "semantic-release": "^25.0.2", - "stream-chat": "^9.35.0", + "stream-chat": "^9.37.0", "ts-jest": "^29.2.5", "typescript": "^5.4.5", "typescript-eslint": "^8.17.0", diff --git a/src/components/MessageInput/MessageComposerActions.tsx b/src/components/MessageInput/MessageComposerActions.tsx index 7eedfc2699..c00c5518da 100644 --- a/src/components/MessageInput/MessageComposerActions.tsx +++ b/src/components/MessageInput/MessageComposerActions.tsx @@ -8,7 +8,7 @@ import { useMessageInputContext, } from '../../context'; import { AIStates, useAIState } from '../AIStateIndicator'; -import { useMessageComposer, useMessageCompositionIsEmpty } from './hooks'; +import { useMessageComposer, useMessageContentIsEmpty } from './hooks'; import { AudioRecordingButtonWithNotification } from '../MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification'; import { useIsCooldownActive } from './hooks/useIsCooldownActive'; import type { MessageComposerState, TextComposerState } from 'stream-chat'; @@ -44,7 +44,7 @@ export const MessageComposerActions = () => { textComposerStateSelector, ); - const compositionIsEmpty = useMessageCompositionIsEmpty(); + const contentIsEmpty = useMessageContentIsEmpty(); /** * This bit here is needed to make sure that we can get rid of the default behaviour * if need be. Essentially, this allows us to pass StopAIGenerationButton={null} and @@ -81,7 +81,7 @@ export const MessageComposerActions = () => { if (isCooldownActive) { content = ; - } else if (compositionIsEmpty && !editedMessage && recordingEnabled) { + } else if (contentIsEmpty && !editedMessage && recordingEnabled) { content = ; } diff --git a/src/components/MessageInput/MessageInput.tsx b/src/components/MessageInput/MessageInput.tsx index 3c5968bcdd..b761ddd916 100644 --- a/src/components/MessageInput/MessageInput.tsx +++ b/src/components/MessageInput/MessageInput.tsx @@ -111,7 +111,7 @@ const MessageInputProvider = (props: PropsWithChildren) => { if ( !threadId || !messageComposer.channel || - !messageComposer.compositionIsEmpty || + !messageComposer.contentIsEmpty || !messageComposer.config.drafts.enabled ) return; diff --git a/src/components/MessageInput/hooks/index.ts b/src/components/MessageInput/hooks/index.ts index ef36b94c02..1344b2b693 100644 --- a/src/components/MessageInput/hooks/index.ts +++ b/src/components/MessageInput/hooks/index.ts @@ -5,4 +5,4 @@ export * from './useCooldownRemaining'; export * from './useMessageInputControls'; export * from './useMessageComposer'; export * from './useMessageComposerHasSendableData'; -export * from './useMessageCompositionIsEmpty'; +export * from './useMessageContentIsEmpty'; diff --git a/src/components/MessageInput/hooks/useMessageCompositionIsEmpty.ts b/src/components/MessageInput/hooks/useMessageContentIsEmpty.ts similarity index 79% rename from src/components/MessageInput/hooks/useMessageCompositionIsEmpty.ts rename to src/components/MessageInput/hooks/useMessageContentIsEmpty.ts index 2f2562b6d0..7a7cf783e5 100644 --- a/src/components/MessageInput/hooks/useMessageCompositionIsEmpty.ts +++ b/src/components/MessageInput/hooks/useMessageContentIsEmpty.ts @@ -4,8 +4,8 @@ import { useStateStore } from '../../../store'; const editingAuditStateStateSelector = (state: EditingAuditState) => state; -export const useMessageCompositionIsEmpty = () => { +export const useMessageContentIsEmpty = () => { const messageComposer = useMessageComposer(); useStateStore(messageComposer.editingAuditState, editingAuditStateStateSelector); - return messageComposer.compositionIsEmpty; + return messageComposer.contentIsEmpty; }; diff --git a/yarn.lock b/yarn.lock index 61543ca41c..26113f43f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11919,10 +11919,10 @@ stdin-discarder@^0.2.2: resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.2.2.tgz#390037f44c4ae1a1ae535c5fe38dc3aba8d997be" integrity sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ== -stream-chat@^9.35.0: - version "9.35.0" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.35.0.tgz#667a046b16dc60675eca102e2c7a4f2a0ca23351" - integrity sha512-WQU3IbVmqUUjwNPgMCiPSKSOUXwfYDbTrQF/ijrSrT0XAFGyi7uZff8vdiTnz9jPE+ZZcuHojN9c9DAw4m1FFQ== +stream-chat@^9.37.0: + version "9.37.0" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.37.0.tgz#6a791197114fc4d30379740659a9f6efcc8f1794" + integrity sha512-AeFgc5jp2DvZtLwv+VIZ7qbPGaZL79eS15Vd5RJPDhLNov93NmXu+Nvdl6lE2qYdRw1Fur/2dB+WA015hj/l6A== dependencies: "@types/jsonwebtoken" "^9.0.8" "@types/ws" "^8.5.14"