Make more code conform to strict null checks (#10219

* Make more code conform to strict null checks

* Fix types

* Fix tests

* Fix remaining test assertions

* Iterate PR
This commit is contained in:
Michael Telatynski 2023-02-24 15:28:40 +00:00 committed by GitHub
parent 4c79ecf141
commit 76b82b4b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 603 additions and 603 deletions

View file

@ -39,8 +39,8 @@ interface IState {
layout: Layout;
// User profile data for the message preview
userId?: string;
displayName: string;
avatarUrl: string;
displayName?: string;
avatarUrl?: string;
}
export default class FontScalingPanel extends React.Component<IProps, IState> {
@ -55,16 +55,13 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
fontSize: (SettingsStore.getValue("baseFontSize", null) + FontWatcher.SIZE_DIFF).toString(),
useCustomFontSize: SettingsStore.getValue("useCustomFontSize"),
layout: SettingsStore.getValue("layout"),
userId: null,
displayName: null,
avatarUrl: null,
};
}
public async componentDidMount(): Promise<void> {
// Fetch the current user profile for the message preview
const client = MatrixClientPeg.get();
const userId = client.getUserId();
const userId = client.getUserId()!;
const profileInfo = await client.getProfileInfo(userId);
if (this.unmounted) return;