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 committed Oct 17, 2017
1 parent a38d917 commit ddd6a73
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 ddd6a73

Please sign in to comment.