Conform more of the codebase to strictNullChecks (#10505
* Conform more of the codebase to `strictNullChecks` * Iterate * Conform more of the codebase to `strictNullChecks` * Iterate * Iterate * Iterate * Iterate
This commit is contained in:
parent
7503bf6b96
commit
e5a314617a
21 changed files with 76 additions and 83 deletions
|
@ -250,7 +250,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
|
|||
// The members should already be loading, and loadMembersIfNeeded
|
||||
// will return the promise for the existing operation
|
||||
this.props.room.loadMembersIfNeeded().then(() => {
|
||||
const me = this.props.room.getMember(MatrixClientPeg.get().getUserId()!);
|
||||
const me = this.props.room.getMember(MatrixClientPeg.get().getSafeUserId()) ?? undefined;
|
||||
this.setState({ me });
|
||||
});
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ type OverflowMenuCloser = () => void;
|
|||
export const OverflowMenuContext = createContext<OverflowMenuCloser | null>(null);
|
||||
|
||||
const MessageComposerButtons: React.FC<IProps> = (props: IProps) => {
|
||||
const matrixClient: MatrixClient = useContext(MatrixClientContext);
|
||||
const matrixClient = useContext(MatrixClientContext);
|
||||
const { room, roomId, narrow } = useContext(RoomContext);
|
||||
|
||||
const isWysiwygLabEnabled = useSettingValue<boolean>("feature_wysiwyg_composer");
|
||||
|
@ -183,7 +183,7 @@ const UploadButtonContextProvider: React.FC<IUploadButtonProps> = ({ roomId, rel
|
|||
const uploadInput = useRef<HTMLInputElement>();
|
||||
|
||||
const onUploadClick = (): void => {
|
||||
if (cli.isGuest()) {
|
||||
if (cli?.isGuest()) {
|
||||
dis.dispatch({ action: "require_registration" });
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ export default function EditWysiwygComposer({
|
|||
const { editMessage, endEditing, onChange, isSaveDisabled } = useEditing(editorStateTransfer, initialContent);
|
||||
|
||||
if (!isReady) {
|
||||
return null;
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue