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

Commit 2a4edef

Browse files
committed
Fix wrong E2E icon in room header for unencrypted local room
1 parent 2344eaa commit 2a4edef

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Diff for: src/components/structures/RoomView.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
301301
onSearchClick={null}
302302
onInviteClick={null}
303303
onForgetClick={null}
304-
e2eStatus={E2EStatus.Normal}
304+
e2eStatus={room.encrypted ? E2EStatus.Normal : undefined}
305305
onAppsClick={null}
306306
appsShown={false}
307307
excludedRightPanelPhaseButtons={[]}
@@ -327,6 +327,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
327327
}
328328

329329
interface ILocalRoomCreateLoaderProps {
330+
localRoom: LocalRoom;
330331
names: string;
331332
resizeNotifier: ResizeNotifier;
332333
}
@@ -350,7 +351,7 @@ function LocalRoomCreateLoader(props: ILocalRoomCreateLoaderProps): ReactElement
350351
onSearchClick={null}
351352
onInviteClick={null}
352353
onForgetClick={null}
353-
e2eStatus={E2EStatus.Normal}
354+
e2eStatus={props.localRoom.encrypted ? E2EStatus.Normal : undefined}
354355
onAppsClick={null}
355356
appsShown={false}
356357
excludedRightPanelPhaseButtons={[]}
@@ -1918,11 +1919,11 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
19181919
return this.getPermalinkCreatorForRoom(this.state.room);
19191920
}
19201921

1921-
private renderLocalRoomCreateLoader(): ReactElement {
1922+
private renderLocalRoomCreateLoader(localRoom: LocalRoom): ReactElement {
19221923
const names = this.state.room.getDefaultRoomName(this.context.client.getUserId());
19231924
return (
19241925
<RoomContext.Provider value={this.state}>
1925-
<LocalRoomCreateLoader names={names} resizeNotifier={this.props.resizeNotifier} />
1926+
<LocalRoomCreateLoader localRoom={localRoom} names={names} resizeNotifier={this.props.resizeNotifier} />
19261927
</RoomContext.Provider>
19271928
);
19281929
}
@@ -1956,7 +1957,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
19561957
public render(): React.ReactNode {
19571958
if (this.state.room instanceof LocalRoom) {
19581959
if (this.state.room.state === LocalRoomState.CREATING) {
1959-
return this.renderLocalRoomCreateLoader();
1960+
return this.renderLocalRoomCreateLoader(this.state.room);
19601961
}
19611962

19621963
return this.renderLocalRoomView(this.state.room);

Diff for: test/components/structures/__snapshots__/RoomView-test.tsx.snap

-6
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
136136
</span>
137137
</div>
138138
</div>
139-
<div
140-
class="mx_E2EIcon mx_E2EIcon_normal mx_RoomHeader_icon"
141-
/>
142139
<div
143140
class="mx_RoomHeader_name mx_RoomHeader_name--textonly"
144141
>
@@ -329,9 +326,6 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
329326
</span>
330327
</div>
331328
</div>
332-
<div
333-
class="mx_E2EIcon mx_E2EIcon_normal mx_RoomHeader_icon"
334-
/>
335329
<div
336330
class="mx_RoomHeader_name mx_RoomHeader_name--textonly"
337331
>

0 commit comments

Comments
 (0)