File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
package/src/contexts/messageInputContext Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ import {
1616 // createDraftCommandInjectionMiddleware,
1717 LocalMessage ,
1818 Message ,
19+ MessageComposer ,
1920 SendMessageOptions ,
2021 StreamChat ,
21- Message as StreamMessage ,
2222 // TextComposerMiddleware,
23+ Message as StreamMessage ,
2324 UpdateMessageOptions ,
2425 UploadRequestFn ,
2526 UserResponse ,
@@ -624,8 +625,16 @@ export const MessageInputProvider = ({
624625 }
625626 } else {
626627 try {
627- // we will handle this specific case in the poll creation dialog
628- if ( ! localMessage . poll_id ) {
628+ // Since the message id does not get cleared, we have to handle this manually
629+ // and let the poll creation dialog handle clearing the rest of the state. Once
630+ // sending a message has been moved to the composer as an API, this will be
631+ // redundant and can be removed.
632+ if ( localMessage . poll_id ) {
633+ messageComposer . state . partialNext ( {
634+ id : MessageComposer . generateId ( ) ,
635+ pollId : null ,
636+ } ) ;
637+ } else {
629638 messageComposer . clear ( ) ;
630639 }
631640 await value . sendMessage ( {
You can’t perform that action at this time.
0 commit comments