Conform more of the codebase with strictNullChecks
(#10703)
This commit is contained in:
parent
db40479910
commit
619a9e8542
24 changed files with 108 additions and 77 deletions
|
@ -49,7 +49,7 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
|
|||
super(props);
|
||||
|
||||
const config = SdkConfig.get();
|
||||
this.defaultServer = config["validated_server_config"];
|
||||
this.defaultServer = config["validated_server_config"]!;
|
||||
const { serverConfig } = this.props;
|
||||
|
||||
let otherHomeserver = "";
|
||||
|
@ -152,11 +152,11 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
|
|||
private onSubmit = async (ev: SyntheticEvent): Promise<void> => {
|
||||
ev.preventDefault();
|
||||
|
||||
const valid = await this.fieldRef.current.validate({ allowEmpty: false });
|
||||
const valid = await this.fieldRef.current?.validate({ allowEmpty: false });
|
||||
|
||||
if (!valid && !this.state.defaultChosen) {
|
||||
this.fieldRef.current.focus();
|
||||
this.fieldRef.current.validate({ allowEmpty: false, focused: true });
|
||||
this.fieldRef.current?.focus();
|
||||
this.fieldRef.current?.validate({ allowEmpty: false, focused: true });
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1089,7 +1089,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
if (rovingContext.state.refs.length > 0) {
|
||||
if (rovingContext.state.activeRef && rovingContext.state.refs.length > 0) {
|
||||
let refs = rovingContext.state.refs;
|
||||
if (!query && !filter !== null) {
|
||||
// If the current selection is not in the recently viewed row then only include the
|
||||
|
@ -1112,6 +1112,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||
if (
|
||||
!query &&
|
||||
!filter !== null &&
|
||||
rovingContext.state.activeRef &&
|
||||
rovingContext.state.refs.length > 0 &&
|
||||
refIsForRecentlyViewed(rovingContext.state.activeRef)
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue