mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
Merge pull request #4151 from matrix-org/t3chguy/search_result_quote
Fix Quote on search results page
This commit is contained in:
commit
480636e554
2 changed files with 26 additions and 4 deletions
|
@ -559,13 +559,19 @@ export default createReactClass({
|
||||||
case 'view_user_info':
|
case 'view_user_info':
|
||||||
this._viewUser(payload.userId, payload.subAction);
|
this._viewUser(payload.userId, payload.subAction);
|
||||||
break;
|
break;
|
||||||
case 'view_room':
|
case 'view_room': {
|
||||||
// Takes either a room ID or room alias: if switching to a room the client is already
|
// Takes either a room ID or room alias: if switching to a room the client is already
|
||||||
// known to be in (eg. user clicks on a room in the recents panel), supply the ID
|
// known to be in (eg. user clicks on a room in the recents panel), supply the ID
|
||||||
// If the user is clicking on a room in the context of the alias being presented
|
// If the user is clicking on a room in the context of the alias being presented
|
||||||
// to them, supply the room alias. If both are supplied, the room ID will be ignored.
|
// to them, supply the room alias. If both are supplied, the room ID will be ignored.
|
||||||
this._viewRoom(payload);
|
const promise = this._viewRoom(payload);
|
||||||
|
if (payload.deferred_action) {
|
||||||
|
promise.then(() => {
|
||||||
|
dis.dispatch(payload.deferred_action);
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 'view_prev_room':
|
case 'view_prev_room':
|
||||||
this._viewNextRoom(-1);
|
this._viewNextRoom(-1);
|
||||||
break;
|
break;
|
||||||
|
@ -862,7 +868,7 @@ export default createReactClass({
|
||||||
waitFor = this.firstSyncPromise.promise;
|
waitFor = this.firstSyncPromise.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
waitFor.then(() => {
|
return waitFor.then(() => {
|
||||||
let presentedId = roomInfo.room_alias || roomInfo.room_id;
|
let presentedId = roomInfo.room_alias || roomInfo.room_id;
|
||||||
const room = MatrixClientPeg.get().getRoom(roomInfo.room_id);
|
const room = MatrixClientPeg.get().getRoom(roomInfo.room_id);
|
||||||
if (room) {
|
if (room) {
|
||||||
|
@ -885,7 +891,7 @@ export default createReactClass({
|
||||||
presentedId += "/" + roomInfo.event_id;
|
presentedId += "/" + roomInfo.event_id;
|
||||||
}
|
}
|
||||||
newState.ready = true;
|
newState.ready = true;
|
||||||
this.setState(newState, ()=>{
|
this.setState(newState, () => {
|
||||||
this.notifyNewScreen('room/' + presentedId);
|
this.notifyNewScreen('room/' + presentedId);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -614,6 +614,22 @@ export default createReactClass({
|
||||||
this.onCancelSearchClick();
|
this.onCancelSearchClick();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'quote':
|
||||||
|
if (this.state.searchResults) {
|
||||||
|
const roomId = payload.event.getRoomId();
|
||||||
|
if (roomId === this.state.roomId) {
|
||||||
|
this.onCancelSearchClick();
|
||||||
|
}
|
||||||
|
|
||||||
|
setImmediate(() => {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'view_room',
|
||||||
|
room_id: roomId,
|
||||||
|
deferred_action: payload,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue