Skip to content

Commit

Permalink
Merge pull request #8514 from RocketChat/hotfix/uncessary-route-reload
Browse files Browse the repository at this point in the history
[FIX] Uncessary route reload break some routes
  • Loading branch information
rodrigok authored Oct 17, 2017
2 parents 50cce81 + 3f96466 commit 737abc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rocketchat-ui/client/lib/RoomManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
});

Expand Down

0 comments on commit 737abc3

Please sign in to comment.