Skip to content
Snippets Groups Projects
Unverified Commit a6a8f27b authored by Douglas Gubert's avatar Douglas Gubert Committed by GitHub
Browse files

fix(apps): room converter errors out when converting livechat room closed by the visitor (#35107)

parent 6d2f84c6
No related branches found
No related tags found
No related merge requests found
---
'@rocket.chat/meteor': patch
---
Fixes an issue where the room converter would throw if the room was an omnichannel room that had been closed by the visitor
......@@ -68,11 +68,18 @@ export class AppRoomsConverter {
let closedBy;
if (room.closedBy) {
const user = await Users.findOneById(room.closedBy.id);
closedBy = {
_id: user._id,
username: user.username,
};
if (room.closer === 'user') {
const user = await Users.findOneById(room.closedBy.id);
closedBy = {
_id: user._id,
username: user.username,
};
} else if (room.closer === 'visitor') {
closedBy = {
_id: v._id,
username: v.username,
};
}
}
let contactId;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment