Harden settings types (#33311)

* Harden settings types

* Fix types

* Update apps/web/src/emojipicker/recent.ts

Co-authored-by: Will Hunt <2072976+Half-Shot@users.noreply.github.com>

* Fix suggestion

---------

Co-authored-by: Will Hunt <2072976+Half-Shot@users.noreply.github.com>
This commit is contained in:
Michael Telatynski
2026-04-29 08:46:09 +00:00
committed by GitHub
co-authored by Will Hunt
parent 4bee845010
commit 5ff302539e
26 changed files with 104 additions and 97 deletions
@@ -231,7 +231,7 @@ export class EventContentBodyViewModel
"TextualBody.enableBigEmoji",
null,
(_settingName, _roomId, _level, _newValAtLevel, newVal) => {
this.setEnableBigEmoji(newVal);
this.setEnableBigEmoji(!!newVal);
},
);
this.disposables.track(() => SettingsStore.unwatchSetting(enableBigEmojiWatcherRef));
@@ -240,7 +240,7 @@ export class EventContentBodyViewModel
"Pill.shouldShowPillAvatar",
null,
(_settingName, _roomId, _level, _newValAtLevel, newVal) => {
this.setShouldShowPillAvatar(newVal);
this.setShouldShowPillAvatar(!!newVal);
},
);
this.disposables.track(() => SettingsStore.unwatchSetting(shouldShowPillAvatarWatcherRef));
@@ -75,7 +75,7 @@ export class RedactedBodyViewModel
(_settingName, _roomId, _level, _newValAtLevel, newVal) => {
if (this.showTwelveHour === newVal) return;
this.showTwelveHour = newVal;
this.showTwelveHour = !!newVal;
this.updateTooltip();
},
);
@@ -296,7 +296,7 @@ export class UrlPreviewGroupViewModel
null,
(_setting, _roomid, _level, compactLayout) => {
this.snapshot.merge({
compactLayout,
compactLayout: !!compactLayout,
});
},
);
@@ -79,7 +79,7 @@ export class DateSeparatorViewModel
"feature_jump_to_date",
null,
(_settingName, _roomId, _level, _newValAtLevel, newVal) => {
this.jumpToDateEnabled = newVal;
this.jumpToDateEnabled = !!newVal;
this.updateSnapshot();
},
);
@@ -89,7 +89,7 @@ export class DateSeparatorViewModel
UIFeature.TimelineEnableRelativeDates,
null,
(_settingName, _roomId, _level, _newValAtLevel, newVal) => {
this.relativeDatesEnabled = newVal;
this.relativeDatesEnabled = !!newVal;
this.updateSnapshot();
},
);