File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ export default function useDialogViewModel(
67
67
let participants : Array < number > = [ ] ;
68
68
let userDictionary : Record < number , UserEntity > = { } ;
69
69
70
- if ( dialog . type === DialogType . group ) {
70
+ if ( dialog ? .type === DialogType . group ) {
71
71
participants = ( dialog as GroupDialogEntity ) . participantIds ;
72
- } else if ( dialog . type === DialogType . private ) {
72
+ } else if ( dialog ? .type === DialogType . private ) {
73
73
participants = [ ( dialog as PrivateDialogEntity ) . participantId ] ;
74
- } else if ( dialog . type === DialogType . public ) {
74
+ } else if ( dialog ? .type === DialogType . public ) {
75
75
participants = [ ] ;
76
76
}
77
77
const getAllUsersFromDialogByIdsUseCase : GetUsersByIdsUseCase =
Original file line number Diff line number Diff line change @@ -777,12 +777,16 @@ const QuickBloxUIKitDesktopLayout: React.FC<
777
777
778
778
useEffect ( ( ) => {
779
779
console . log ( 'HAVE NEW ENTITY' ) ;
780
- messagesViewModel . getMessages ( new Pagination ( ) ) ;
780
+ if ( messagesViewModel . entity ) {
781
+ messagesViewModel . getMessages ( new Pagination ( ) ) ;
782
+ }
781
783
} , [ messagesViewModel . entity ] ) ;
782
784
//
783
785
useEffect ( ( ) => {
784
786
console . log ( 'HAVE NEW ENTITY' ) ;
785
- dialogsViewModel . setWaitLoadingStatus ( messagesViewModel ?. loading ) ;
787
+ if ( messagesViewModel . entity ) {
788
+ dialogsViewModel . setWaitLoadingStatus ( messagesViewModel ?. loading ) ;
789
+ }
786
790
} , [ messagesViewModel ?. loading ] ) ;
787
791
//
788
792
function prepareFirstPage ( initData : MessageEntity [ ] ) {
You can’t perform that action at this time.
0 commit comments