Skip to content

Commit f0c10b4

Browse files
up to 0.2.6-betta.2
1 parent aa211a9 commit f0c10b4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Presentation/Views/Dialog/useDialogViewModel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ export default function useDialogViewModel(
6767
let participants: Array<number> = [];
6868
let userDictionary: Record<number, UserEntity> = {};
6969

70-
if (dialog.type === DialogType.group) {
70+
if (dialog?.type === DialogType.group) {
7171
participants = (dialog as GroupDialogEntity).participantIds;
72-
} else if (dialog.type === DialogType.private) {
72+
} else if (dialog?.type === DialogType.private) {
7373
participants = [(dialog as PrivateDialogEntity).participantId];
74-
} else if (dialog.type === DialogType.public) {
74+
} else if (dialog?.type === DialogType.public) {
7575
participants = [];
7676
}
7777
const getAllUsersFromDialogByIdsUseCase: GetUsersByIdsUseCase =

src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,12 +777,16 @@ const QuickBloxUIKitDesktopLayout: React.FC<
777777

778778
useEffect(() => {
779779
console.log('HAVE NEW ENTITY');
780-
messagesViewModel.getMessages(new Pagination());
780+
if (messagesViewModel.entity) {
781+
messagesViewModel.getMessages(new Pagination());
782+
}
781783
}, [messagesViewModel.entity]);
782784
//
783785
useEffect(() => {
784786
console.log('HAVE NEW ENTITY');
785-
dialogsViewModel.setWaitLoadingStatus(messagesViewModel?.loading);
787+
if (messagesViewModel.entity) {
788+
dialogsViewModel.setWaitLoadingStatus(messagesViewModel?.loading);
789+
}
786790
}, [messagesViewModel?.loading]);
787791
//
788792
function prepareFirstPage(initData: MessageEntity[]) {

0 commit comments

Comments
 (0)