Conform more of the codebase to strictNullChecks
(#10358
* Conform more of the codebase to `strictNullChecks` * Fix types * Iterate * Iterate
This commit is contained in:
parent
41d88ad6ae
commit
503df62191
76 changed files with 323 additions and 327 deletions
|
@ -166,7 +166,7 @@ const NewRoomIntro: React.FC = () => {
|
|||
const creator = room.currentState.getStateEvents(EventType.RoomCreate, "")?.getSender();
|
||||
const creatorName = room?.getMember(creator)?.rawDisplayName || creator;
|
||||
|
||||
let createdText;
|
||||
let createdText: string;
|
||||
if (creator === cli.getUserId()) {
|
||||
createdText = _t("You created this room.");
|
||||
} else {
|
||||
|
@ -175,15 +175,15 @@ const NewRoomIntro: React.FC = () => {
|
|||
});
|
||||
}
|
||||
|
||||
let parentSpace: Room;
|
||||
let parentSpace: Room | undefined;
|
||||
if (
|
||||
SpaceStore.instance.activeSpaceRoom?.canInvite(cli.getUserId()) &&
|
||||
SpaceStore.instance.activeSpaceRoom?.canInvite(cli.getSafeUserId()) &&
|
||||
SpaceStore.instance.isRoomInSpace(SpaceStore.instance.activeSpace, room.roomId)
|
||||
) {
|
||||
parentSpace = SpaceStore.instance.activeSpaceRoom;
|
||||
}
|
||||
|
||||
let buttons;
|
||||
let buttons: JSX.Element | undefined;
|
||||
if (parentSpace && shouldShowComponent(UIComponent.InviteUsers)) {
|
||||
buttons = (
|
||||
<div className="mx_NewRoomIntro_buttons">
|
||||
|
@ -191,12 +191,12 @@ const NewRoomIntro: React.FC = () => {
|
|||
className="mx_NewRoomIntro_inviteButton"
|
||||
kind="primary"
|
||||
onClick={() => {
|
||||
showSpaceInvite(parentSpace);
|
||||
showSpaceInvite(parentSpace!);
|
||||
}}
|
||||
>
|
||||
{_t("Invite to %(spaceName)s", { spaceName: parentSpace.name })}
|
||||
</AccessibleButton>
|
||||
{room.canInvite(cli.getUserId()) && (
|
||||
{room.canInvite(cli.getSafeUserId()) && (
|
||||
<AccessibleButton
|
||||
className="mx_NewRoomIntro_inviteButton"
|
||||
kind="primary_outline"
|
||||
|
@ -209,7 +209,7 @@ const NewRoomIntro: React.FC = () => {
|
|||
)}
|
||||
</div>
|
||||
);
|
||||
} else if (room.canInvite(cli.getUserId()) && shouldShowComponent(UIComponent.InviteUsers)) {
|
||||
} else if (room.canInvite(cli.getSafeUserId()) && shouldShowComponent(UIComponent.InviteUsers)) {
|
||||
buttons = (
|
||||
<div className="mx_NewRoomIntro_buttons">
|
||||
<AccessibleButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue