Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

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

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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={[]}
Expand All @@ -327,6 +327,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
}

interface ILocalRoomCreateLoaderProps {
localRoom: LocalRoom;
names: string;
resizeNotifier: ResizeNotifier;
}
Expand All @@ -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={[]}
Expand Down Expand Up @@ -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>
);
}
Expand Down Expand Up @@ -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);
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
Expand Down Expand Up @@ -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"
>
Expand Down Expand Up @@ -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"
>
Expand Down