Skip to content

Commit 8790fbc

Browse files
v0.3.1-beta.3
1 parent 9524b35 commit 8790fbc

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quickblox-react-ui-kit",
3-
"version": "0.3.1-beta.2",
3+
"version": "0.3.1-beta.3",
44
"main": "dist/index-ui.js",
55
"license": "MIT",
66
"dependencies": {

src/Data/mapper/DialogRemoteDTOMapper.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,16 @@ export class DialogRemoteDTOMapper implements IMapper {
7474
);
7575

7676
function formatPhotoUrl() {
77-
if (dialog.photo && dialog.photo !== 'null') {
77+
if (
78+
!dialog.photo.includes('https') &&
79+
dialog.photo &&
80+
dialog.photo !== 'null'
81+
) {
7882
return dialog.photo && QB.content.privateUrl(dialog.photo);
7983
}
8084

85+
if (dialog.photo.includes('https')) return dialog.photo;
86+
8187
return '';
8288
}
8389
switch (dialog.type) {

src/Presentation/Views/Dialog/useDialogViewModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ export default function useDialogViewModel(
434434
if (dialog?.type === DialogType.private) {
435435
const updDialog = { ...dialog };
436436

437-
updDialog.lastMessage.dateSent = messageEntity.date_sent;
437+
updDialog.lastMessage.dateSent = messageEntity.date_sent / 1000;
438438
updDialog.lastMessage.text = messageEntity.message;
439439
updDialog.lastMessage.userId = messageEntity.sender_id;
440440
updDialog.unreadMessageCount = 0;

src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,14 @@ const QuickBloxUIKitDesktopLayout: React.FC<
362362
.participantId,
363363
]
364364
: [];
365-
const senderUser = await userViewModel.getUserById(participants[0]);
366365

367-
result = senderUser?.photo || '';
366+
if (participants.length > 0) {
367+
const senderUser = await userViewModel.getUserById(participants[0]);
368+
369+
result = senderUser?.photo || '';
370+
} else {
371+
result = '';
372+
}
368373

369374
return result;
370375
};

0 commit comments

Comments
 (0)