File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ export class ChannelState<StreamChatGenerics extends ExtendableGenerics = Defaul
500
500
if ( message . poll_id !== pollVote . poll_id ) return ;
501
501
502
502
const updatedPoll = { ...poll } ;
503
- let ownVotes = [ ...( message . poll . own_votes || [ ] ) ] ;
503
+ let ownVotes = [ ...( message . poll ? .own_votes || [ ] ) ] ;
504
504
505
505
if ( pollVote . user_id === this . _channel . getClient ( ) . userID ) {
506
506
if ( pollVote . option_id && poll . enforce_unique_vote ) {
@@ -527,7 +527,7 @@ export class ChannelState<StreamChatGenerics extends ExtendableGenerics = Defaul
527
527
if ( message . poll_id !== pollVote . poll_id ) return ;
528
528
529
529
const updatedPoll = { ...poll } ;
530
- const ownVotes = [ ...( message . poll . own_votes || [ ] ) ] ;
530
+ const ownVotes = [ ...( message . poll ? .own_votes || [ ] ) ] ;
531
531
532
532
if ( pollVote . user_id === this . _channel . getClient ( ) . userID ) {
533
533
ownVotes . push ( pollVote ) ;
@@ -550,7 +550,7 @@ export class ChannelState<StreamChatGenerics extends ExtendableGenerics = Defaul
550
550
if ( message . poll_id !== pollVote . poll_id ) return ;
551
551
552
552
const updatedPoll = { ...poll } ;
553
- const ownVotes = [ ...( message . poll . own_votes || [ ] ) ] ;
553
+ const ownVotes = [ ...( message . poll ? .own_votes || [ ] ) ] ;
554
554
if ( pollVote . user_id === this . _channel . getClient ( ) . userID ) {
555
555
const index = ownVotes . findIndex ( ( vote ) => vote . option_id === pollVote . option_id ) ;
556
556
if ( index > - 1 ) {
Original file line number Diff line number Diff line change @@ -627,7 +627,7 @@ export type MessageResponse<
627
627
export type MessageResponseBase <
628
628
StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
629
629
> = MessageBase < StreamChatGenerics > & {
630
- poll : PollResponse < StreamChatGenerics > ;
630
+ poll ? : PollResponse < StreamChatGenerics > ;
631
631
type : MessageLabel ;
632
632
args ?: string ;
633
633
before_message_send_failed ?: boolean ;
You can’t perform that action at this time.
0 commit comments