File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1367,7 +1367,9 @@ export class Channel {
13671367
13681368 this . getClient ( ) . polls . hydratePollCache ( state . messages , true ) ;
13691369
1370- this . messageComposer . initState ( { composition : state . draft } ) ;
1370+ if ( state . draft ) {
1371+ this . messageComposer . initState ( { composition : state . draft } ) ;
1372+ }
13711373
13721374 const areCapabilitiesChanged =
13731375 [ ...( state . channel . own_capabilities || [ ] ) ] . sort ( ) . join ( ) !==
Original file line number Diff line number Diff line change @@ -1826,7 +1826,10 @@ export class StreamChat {
18261826 } ;
18271827 this . polls . hydratePollCache ( channelState . messages , true ) ;
18281828 }
1829- c . messageComposer . initState ( { composition : channelState . draft } ) ;
1829+
1830+ if ( channelState . draft ) {
1831+ c . messageComposer . initState ( { composition : channelState . draft } ) ;
1832+ }
18301833
18311834 channels . push ( c ) ;
18321835 }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export type MessageComposerOptions = {
4040} ;
4141
4242const isMessageDraft = ( composition : unknown ) : composition is DraftResponse =>
43- ! ! ( composition as { message ?: DraftMessage } ) . message ;
43+ ! ! ( composition as { message ?: DraftMessage } ) ? .message ;
4444
4545const initState = (
4646 composition ?: DraftResponse | MessageResponse | FormatMessageResponse ,
You can’t perform that action at this time.
0 commit comments