Apply strictNullChecks to src/settings/* (#10252
* Apply strictNullChecks to src/settings/* * Fix inherited types
This commit is contained in:
parent
95223c87fe
commit
eca28ac2f3
5 changed files with 20 additions and 24 deletions
|
@ -45,13 +45,13 @@ const defaultWatchManager = new WatchManager();
|
|||
const defaultSettings: Record<string, any> = {};
|
||||
const invertedDefaultSettings: Record<string, boolean> = {};
|
||||
const featureNames: string[] = [];
|
||||
for (const key of Object.keys(SETTINGS)) {
|
||||
defaultSettings[key] = SETTINGS[key].default;
|
||||
if (SETTINGS[key].isFeature) featureNames.push(key);
|
||||
if (SETTINGS[key].invertedSettingName) {
|
||||
// Invert now so that the rest of the system will invert it back
|
||||
// to what was intended.
|
||||
invertedDefaultSettings[SETTINGS[key].invertedSettingName] = !SETTINGS[key].default;
|
||||
for (const key in SETTINGS) {
|
||||
const setting = SETTINGS[key];
|
||||
defaultSettings[key] = setting.default;
|
||||
if (setting.isFeature) featureNames.push(key);
|
||||
if (setting.invertedSettingName) {
|
||||
// Invert now so that the rest of the system will invert it back to what was intended.
|
||||
invertedDefaultSettings[setting.invertedSettingName] = !setting.default;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ export default class SettingsStore {
|
|||
if (roomId === null) {
|
||||
// Unregister all existing watchers and register the new one
|
||||
rooms.forEach((roomId) => {
|
||||
SettingsStore.unwatchSetting(this.monitors.get(settingName)!.get(roomId));
|
||||
SettingsStore.unwatchSetting(this.monitors.get(settingName)!.get(roomId)!);
|
||||
});
|
||||
this.monitors.get(settingName)!.clear();
|
||||
registerWatcher();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue