mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Navigate to the upgraded room's create event where possible
Fixes https://github.com/vector-im/riot-web/issues/7998
This commit is contained in:
parent
e9226cdff8
commit
b09219fe33
1 changed files with 8 additions and 0 deletions
|
@ -281,9 +281,17 @@ export default class MessageComposer extends React.Component {
|
|||
ev.preventDefault();
|
||||
|
||||
const replacementRoomId = this.state.tombstone.getContent()['replacement_room'];
|
||||
const replacementRoom = MatrixClientPeg.get().getRoom(replacementRoomId);
|
||||
let createEventId = null;
|
||||
if (replacementRoom) {
|
||||
const createEvent = replacementRoom.currentState.getStateEvents('m.room.create', '');
|
||||
if (createEvent && createEvent.getId()) createEventId = createEvent.getId();
|
||||
}
|
||||
|
||||
this.props.roomViewStore.getDispatcher().dispatch({
|
||||
action: 'view_room',
|
||||
highlighted: true,
|
||||
event_id: createEventId,
|
||||
room_id: replacementRoomId,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue