Skip to content

Commit

Permalink
fix: replace deprecated render property
Browse files Browse the repository at this point in the history
  • Loading branch information
Devansht420 committed Jan 16, 2024
1 parent 9d6cf47 commit b8ebe59
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions apps/meteor/app/livechat/lib/messageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,25 @@ MessageTypes.registerType({

MessageTypes.registerType({
id: 'livechat_webrtc_video_call',
render(message) {
message: 'room_changed_type',
data(message) {
if (message.msg === 'ended' && message.webRtcCallEndTs && message.ts) {
return t('WebRTC_call_ended_message', {
callDuration: formatDistance(new Date(message.webRtcCallEndTs), new Date(message.ts)),
endTime: moment(message.webRtcCallEndTs).format('h:mm A'),
});
return {
message: t('WebRTC_call_ended_message', {
callDuration: formatDistance(new Date(message.webRtcCallEndTs), new Date(message.ts)),
endTime: moment(message.webRtcCallEndTs).format('h:mm A'),
}),
};
}
if (message.msg === 'declined' && message.webRtcCallEndTs) {
return t('WebRTC_call_declined_message');
return {
message: t('WebRTC_call_declined_message'),
};
}
return escapeHTML(message.msg);
return {
message: escapeHTML(message.msg),
};
},
message: 'room_changed_type',
});

MessageTypes.registerType({
Expand Down

0 comments on commit b8ebe59

Please sign in to comment.