Wire local room logic (#9078)

* Wire local room logic

* Migrate to testling-lib; update test descriptions
This commit is contained in:
Michael Weimann 2022-07-20 09:26:25 +02:00 committed by GitHub
parent 66f7c9f564
commit fa1bff67cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 494 additions and 12 deletions

View file

@ -132,6 +132,7 @@ import VideoChannelStore from "../../stores/VideoChannelStore";
import { IRoomStateEventsActionPayload } from "../../actions/MatrixActionCreators";
import { UseCaseSelection } from '../views/elements/UseCaseSelection';
import { ValidatedServerConfig } from '../../utils/ValidatedServerConfig';
import { isLocalRoom } from '../../utils/localRoom/isLocalRoom';
// legacy export
export { default as Views } from "../../Views";
@ -890,7 +891,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}
// If we are redirecting to a Room Alias and it is for the room we already showing then replace history item
const replaceLast = presentedId[0] === "#" && roomInfo.room_id === this.state.currentRoomId;
let replaceLast = presentedId[0] === "#" && roomInfo.room_id === this.state.currentRoomId;
if (isLocalRoom(this.state.currentRoomId)) {
// Replace local room history items
replaceLast = true;
}
if (roomInfo.room_id === this.state.currentRoomId) {
// if we are re-viewing the same room then copy any state we already know