Conform more code to strict null checking (#10167)

* Conform more code to strict null checking

* Delint

* Iterate PR based on feedback
This commit is contained in:
Michael Telatynski 2023-02-16 17:21:44 +00:00 committed by GitHub
parent f7bea2cae5
commit 4574c665ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 517 additions and 495 deletions

View file

@ -36,7 +36,7 @@ export default class IncompatibleController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
if (this.incompatibleSetting) {
return this.forcedValue;

View file

@ -53,7 +53,7 @@ export class NotificationsEnabledController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
if (!getNotifier().isPossible()) return false;

View file

@ -35,7 +35,7 @@ export class OrderedMultiController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
for (const controller of this.controllers) {
const override = controller.getValueOverride(level, roomId, calculatedValue, calculatedAtLevel);

View file

@ -27,7 +27,7 @@ export default class ReducedMotionController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
if (this.prefersReducedMotion()) {
return false;

View file

@ -41,7 +41,7 @@ export default abstract class SettingController {
level: SettingLevel,
roomId: string | null,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
return null; // no override
}

View file

@ -26,7 +26,7 @@ export default class ThemeController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
if (!calculatedValue) return null; // Don't override null themes

View file

@ -34,7 +34,7 @@ export default class UIFeatureController extends SettingController {
level: SettingLevel,
roomId: string,
calculatedValue: any,
calculatedAtLevel: SettingLevel,
calculatedAtLevel: SettingLevel | null,
): any {
if (this.settingDisabled) {
// per the docs: we force a disabled state when the feature isn't active