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:
@@ -274,19 +274,22 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
||||
await Promise.all(
|
||||
Object.entries(contentMap).flatMap(([userId, userContentMap]) =>
|
||||
Object.entries(userContentMap).map(async ([deviceId, content]): Promise<void> => {
|
||||
const devices = deviceInfoMap.get(userId);
|
||||
if (!devices) return;
|
||||
|
||||
if (deviceId === "*") {
|
||||
// Send the message to all devices we have keys for
|
||||
await client.encryptAndSendToDevices(
|
||||
Array.from(deviceInfoMap.get(userId).values()).map((deviceInfo) => ({
|
||||
Array.from(devices.values()).map((deviceInfo) => ({
|
||||
userId,
|
||||
deviceInfo,
|
||||
})),
|
||||
content,
|
||||
);
|
||||
} else {
|
||||
} else if (devices.has(deviceId)) {
|
||||
// Send the message to a specific device
|
||||
await client.encryptAndSendToDevices(
|
||||
[{ userId, deviceInfo: deviceInfoMap.get(userId).get(deviceId) }],
|
||||
[{ userId, deviceInfo: devices.get(deviceId)! }],
|
||||
content,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore {
|
||||
}
|
||||
|
||||
public getContainerWidgets(room: Optional<Room>, container: Container): IApp[] {
|
||||
return this.byRoom.get(room?.roomId)?.get(container)?.ordered || [];
|
||||
return (room && this.byRoom.get(room.roomId)?.get(container)?.ordered) || [];
|
||||
}
|
||||
|
||||
public isInContainer(room: Room, widget: IApp, container: Container): boolean {
|
||||
|
||||
@@ -58,7 +58,7 @@ export class WidgetPermissionStore {
|
||||
return OIDCState.Unknown;
|
||||
}
|
||||
|
||||
public setOIDCState(widget: Widget, kind: WidgetKind, roomId: string, newState: OIDCState): void {
|
||||
public setOIDCState(widget: Widget, kind: WidgetKind, roomId: string | undefined, newState: OIDCState): void {
|
||||
const settingsKey = this.packSettingKey(widget, kind, roomId);
|
||||
|
||||
let currentValues = SettingsStore.getValue<{
|
||||
|
||||
Reference in New Issue
Block a user