File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1367,7 +1367,9 @@ export class Channel {
1367
1367
1368
1368
this . getClient ( ) . polls . hydratePollCache ( state . messages , true ) ;
1369
1369
1370
- this . messageComposer . initState ( { composition : state . draft } ) ;
1370
+ if ( state . draft ) {
1371
+ this . messageComposer . initState ( { composition : state . draft } ) ;
1372
+ }
1371
1373
1372
1374
const areCapabilitiesChanged =
1373
1375
[ ...( state . channel . own_capabilities || [ ] ) ] . sort ( ) . join ( ) !==
Original file line number Diff line number Diff line change @@ -1826,7 +1826,10 @@ export class StreamChat {
1826
1826
} ;
1827
1827
this . polls . hydratePollCache ( channelState . messages , true ) ;
1828
1828
}
1829
- c . messageComposer . initState ( { composition : channelState . draft } ) ;
1829
+
1830
+ if ( channelState . draft ) {
1831
+ c . messageComposer . initState ( { composition : channelState . draft } ) ;
1832
+ }
1830
1833
1831
1834
channels . push ( c ) ;
1832
1835
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export type MessageComposerOptions = {
40
40
} ;
41
41
42
42
const isMessageDraft = ( composition : unknown ) : composition is DraftResponse =>
43
- ! ! ( composition as { message ?: DraftMessage } ) . message ;
43
+ ! ! ( composition as { message ?: DraftMessage } ) ? .message ;
44
44
45
45
const initState = (
46
46
composition ?: DraftResponse | MessageResponse | FormatMessageResponse ,
You can’t perform that action at this time.
0 commit comments