Skip to content

Commit

Permalink
fix: mention channel redirecting to own DM (#31099)
Browse files Browse the repository at this point in the history
  • Loading branch information
guijun13 authored Nov 30, 2023
1 parent 157f8f4 commit d71876c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-mice-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: mention channel redirecting to own DM
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/hooks/useOpenRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function useOpenRoom({ type, reference }: { type: RoomType; reference: st

const { LegacyRoomManager } = await import('../../../../app/ui-utils/client');

if (room._id !== reference && type === 'd') {
if (reference !== undefined && room._id !== reference && type === 'd') {
// Redirect old url using username to rid
await LegacyRoomManager.close(type + reference);
directRoute.push({ rid: room._id }, (prev) => prev);
Expand Down

0 comments on commit d71876c

Please sign in to comment.