Conform more of the codebase to strictNullChecks (#10731)

This commit is contained in:
Michael Telatynski 2023-04-28 09:45:36 +01:00 committed by GitHub
parent 9f8113eabd
commit 1281c0746b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 147 additions and 119 deletions

View file

@ -272,7 +272,8 @@ export default class LegacyCallHandler extends EventEmitter {
return localNotificationsAreSilenced(cli);
}
public silenceCall(callId: string): void {
public silenceCall(callId?: string): void {
if (!callId) return;
this.silencedCalls.add(callId);
this.emit(LegacyCallHandlerEvent.SilencedCallsChanged, this.silencedCalls);
@ -281,8 +282,8 @@ export default class LegacyCallHandler extends EventEmitter {
this.pause(AudioID.Ring);
}
public unSilenceCall(callId: string): void {
if (this.isForcedSilent()) return;
public unSilenceCall(callId?: string): void {
if (!callId || this.isForcedSilent()) return;
this.silencedCalls.delete(callId);
this.emit(LegacyCallHandlerEvent.SilencedCallsChanged, this.silencedCalls);
this.play(AudioID.Ring);
@ -1182,8 +1183,9 @@ export default class LegacyCallHandler extends EventEmitter {
// Prevent double clicking the call button
const widget = WidgetStore.instance.getApps(roomId).find((app) => WidgetType.JITSI.matches(app.type));
if (widget) {
const room = client.getRoom(roomId);
// If there already is a Jitsi widget, pin it
WidgetLayoutStore.instance.moveToContainer(client.getRoom(roomId), widget, Container.Top);
if (room) WidgetLayoutStore.instance.moveToContainer(room, widget, Container.Top);
return;
}