Conform more of the codebase to strictNullChecks (#10672)

* Conform more of the codebase to `strictNullChecks`

* Iterate

* Iterate

* Iterate

* Iterate

* Conform more of the codebase to `strictNullChecks`

* Iterate

* Update record key
This commit is contained in:
Michael Telatynski
2023-04-21 11:50:42 +01:00
committed by GitHub
parent 792a39a39b
commit be5928cb64
34 changed files with 143 additions and 115 deletions

View File

@@ -27,7 +27,7 @@ export enum CachedRoomKey {
NotificationVolume,
}
export class RoomEchoChamber extends GenericEchoChamber<RoomEchoContext, CachedRoomKey, RoomNotifState> {
export class RoomEchoChamber extends GenericEchoChamber<RoomEchoContext, CachedRoomKey, RoomNotifState | undefined> {
private properties = new Map<CachedRoomKey, RoomNotifState>();
public constructor(context: RoomEchoContext) {
@@ -67,11 +67,12 @@ export class RoomEchoChamber extends GenericEchoChamber<RoomEchoContext, CachedR
// ---- helpers below here ----
public get notificationVolume(): RoomNotifState {
public get notificationVolume(): RoomNotifState | undefined {
return this.getValue(CachedRoomKey.NotificationVolume);
}
public set notificationVolume(v: RoomNotifState) {
public set notificationVolume(v: RoomNotifState | undefined) {
if (v === undefined) return;
this.setValue(
_t("Change notification settings"),
CachedRoomKey.NotificationVolume,