Skip to content
Snippets Groups Projects
Unverified Commit 3f964666 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

[FIX] Uncessary route reload break some routes

parent 50cce814
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,12 @@ Meteor.startup(() => {
if ((currentUsername === undefined) && ((user != null ? user.username : undefined) != null)) {
currentUsername = user.username;
RoomManager.closeAllRooms();
FlowRouter.reload();
const roomTypes = RocketChat.roomTypes.roomTypes;
// Reload only if the current route is a channel route
const roomType = Object.keys(roomTypes).find(key => roomTypes[key].route && roomTypes[key].route.name === FlowRouter.current().route.name);
if (roomType) {
FlowRouter.reload();
}
}
});
......
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