From 26e66326a240b45cd57fd3a447a0bb3918cd1fc4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 22 Feb 2016 12:54:22 +0000 Subject: [PATCH] Link search results to the right room Fixes https://github.com/vector-im/vector-web/issues/980 --- src/components/structures/RoomView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index d423f29bc6..07a8da5eac 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -927,6 +927,7 @@ module.exports = React.createClass({ var result = this.state.searchResults.results[i]; var mxEv = result.context.getEvent(); + var roomId = mxEv.getRoomId(); if (!EventTile.haveTileForEvent(mxEv)) { // XXX: can this ever happen? It will make the result count @@ -935,7 +936,6 @@ module.exports = React.createClass({ } if (this.state.searchScope === 'All') { - var roomId = mxEv.getRoomId(); if(roomId != lastRoomId) { var room = cli.getRoom(roomId); @@ -952,7 +952,7 @@ module.exports = React.createClass({ } } - var resultLink = "#/room/"+this.props.roomId+"/"+mxEv.getId(); + var resultLink = "#/room/"+roomId+"/"+mxEv.getId(); ret.push(