Fix wrong E2E icon in room header for unencrypted local room (#10394)

This commit is contained in:
Michael Weimann 2023-03-16 10:54:54 +01:00 committed by GitHub
parent 2344eaab1c
commit 6d15b05b86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

View file

@ -301,7 +301,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
onSearchClick={null}
onInviteClick={null}
onForgetClick={null}
e2eStatus={E2EStatus.Normal}
e2eStatus={room.encrypted ? E2EStatus.Normal : undefined}
onAppsClick={null}
appsShown={false}
excludedRightPanelPhaseButtons={[]}
@ -327,6 +327,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
}
interface ILocalRoomCreateLoaderProps {
localRoom: LocalRoom;
names: string;
resizeNotifier: ResizeNotifier;
}
@ -350,7 +351,7 @@ function LocalRoomCreateLoader(props: ILocalRoomCreateLoaderProps): ReactElement
onSearchClick={null}
onInviteClick={null}
onForgetClick={null}
e2eStatus={E2EStatus.Normal}
e2eStatus={props.localRoom.encrypted ? E2EStatus.Normal : undefined}
onAppsClick={null}
appsShown={false}
excludedRightPanelPhaseButtons={[]}
@ -1918,11 +1919,11 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
return this.getPermalinkCreatorForRoom(this.state.room);
}
private renderLocalRoomCreateLoader(): ReactElement {
private renderLocalRoomCreateLoader(localRoom: LocalRoom): ReactElement {
const names = this.state.room.getDefaultRoomName(this.context.client.getUserId());
return (
<RoomContext.Provider value={this.state}>
<LocalRoomCreateLoader names={names} resizeNotifier={this.props.resizeNotifier} />
<LocalRoomCreateLoader localRoom={localRoom} names={names} resizeNotifier={this.props.resizeNotifier} />
</RoomContext.Provider>
);
}
@ -1956,7 +1957,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
public render(): React.ReactNode {
if (this.state.room instanceof LocalRoom) {
if (this.state.room.state === LocalRoomState.CREATING) {
return this.renderLocalRoomCreateLoader();
return this.renderLocalRoomCreateLoader(this.state.room);
}
return this.renderLocalRoomView(this.state.room);

View file

@ -39,9 +39,6 @@ exports[`RoomView for a local room in state CREATING should match the snapshot 1
</span>
</div>
</div>
<div
class="mx_E2EIcon mx_E2EIcon_normal mx_RoomHeader_icon"
/>
<div
class="mx_RoomHeader_name mx_RoomHeader_name--textonly"
>
@ -136,9 +133,6 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
</span>
</div>
</div>
<div
class="mx_E2EIcon mx_E2EIcon_normal mx_RoomHeader_icon"
/>
<div
class="mx_RoomHeader_name mx_RoomHeader_name--textonly"
>
@ -329,9 +323,6 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
</span>
</div>
</div>
<div
class="mx_E2EIcon mx_E2EIcon_normal mx_RoomHeader_icon"
/>
<div
class="mx_RoomHeader_name mx_RoomHeader_name--textonly"
>