Conform more of the codebase to strictNullChecks
(#11100)
This commit is contained in:
parent
328db8fdfd
commit
7b3a4e556a
16 changed files with 30 additions and 26 deletions
|
@ -220,7 +220,6 @@ export interface IRoomState {
|
|||
showUrlPreview?: boolean;
|
||||
e2eStatus?: E2EStatus;
|
||||
rejecting?: boolean;
|
||||
rejectError?: Error;
|
||||
hasPinnedWidgets?: boolean;
|
||||
mainSplitContentType?: MainSplitContentType;
|
||||
// whether or not a spaces context switch brought us here,
|
||||
|
@ -1680,7 +1679,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
|
||||
this.setState({
|
||||
rejecting: false,
|
||||
rejectError: error,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
@ -1714,7 +1712,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
|
||||
this.setState({
|
||||
rejecting: false,
|
||||
rejectError: error,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -491,7 +491,7 @@ export default class ScrollPanel extends React.Component<IProps> {
|
|||
// This would cause jumping to happen on Chrome/macOS.
|
||||
return new Promise((resolve) => window.setTimeout(resolve, 1))
|
||||
.then(() => {
|
||||
return this.props.onFillRequest(backwards);
|
||||
return this.props.onFillRequest?.(backwards);
|
||||
})
|
||||
.finally(() => {
|
||||
this.pendingFillRequests[dir] = false;
|
||||
|
|
|
@ -1623,12 +1623,12 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
// dialog, let's jump to the end of the timeline. If we weren't,
|
||||
// something has gone badly wrong and rather than causing a loop of
|
||||
// undismissable dialogs, let's just give up.
|
||||
if (eventId) {
|
||||
if (eventId && this.props.timelineSet.room) {
|
||||
onFinished = () => {
|
||||
// go via the dispatcher so that the URL is updated
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: this.props.timelineSet.room.roomId,
|
||||
room_id: this.props.timelineSet.room!.roomId,
|
||||
metricsTrigger: undefined, // room doesn't change
|
||||
});
|
||||
};
|
||||
|
@ -2098,7 +2098,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
// forwards, otherwise if somebody hits the bottom of the loaded
|
||||
// events when viewing historical messages, we get stuck in a loop
|
||||
// of paginating our way through the entire history of the room.
|
||||
const stickyBottom = !this.timelineWindow.canPaginate(EventTimeline.FORWARDS);
|
||||
const stickyBottom = !this.timelineWindow?.canPaginate(EventTimeline.FORWARDS);
|
||||
|
||||
// If the state is PREPARED or CATCHUP, we're still waiting for the js-sdk to sync with
|
||||
// the HS and fetch the latest events, so we are effectively forward paginating.
|
||||
|
|
|
@ -75,7 +75,7 @@ export default class UserView extends React.Component<IProps, IState> {
|
|||
} catch (err) {
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: _t("Could not load user profile"),
|
||||
description: err && err.message ? err.message : _t("Operation failed"),
|
||||
description: err instanceof Error ? err.message : _t("Operation failed"),
|
||||
});
|
||||
this.setState({ loading: false });
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue