Conform more of the codebase to strictNullChecks (#10607)

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`

* Fix types

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`
This commit is contained in:
Michael Telatynski 2023-04-17 09:25:00 +01:00 committed by GitHub
parent 9d8d610f31
commit 56e4ae41f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 71 additions and 68 deletions

View file

@ -83,7 +83,7 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
};
private onValidateFontSize = async ({ value }: Pick<IFieldState, "value">): Promise<IValidationResult> => {
const parsedSize = parseFloat(value);
const parsedSize = parseFloat(value!);
const min = FontWatcher.MIN_SIZE + FontWatcher.SIZE_DIFF;
const max = FontWatcher.MAX_SIZE + FontWatcher.SIZE_DIFF;
@ -98,7 +98,7 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
};
}
SettingsStore.setValue("baseFontSize", null, SettingLevel.DEVICE, parseInt(value, 10) - FontWatcher.SIZE_DIFF);
SettingsStore.setValue("baseFontSize", null, SettingLevel.DEVICE, parseInt(value!, 10) - FontWatcher.SIZE_DIFF);
return { valid: true, feedback: _t("Use between %(min)s pt and %(max)s pt", { min, max }) };
};