Enable lint rules for Promise handling to discourage misuse of them.

Squashed all of Hugh's commits into one.
This commit is contained in:
Hugh Nimmo-Smith
2024-07-10 16:20:59 +01:00
committed by Timo
parent c2cc0937c1
commit 480a995be1
31 changed files with 332 additions and 198 deletions

View File

@@ -36,6 +36,7 @@ export function makeActiveFocus(): LivekitFocusActive {
};
}
// eslint-disable-next-line @typescript-eslint/require-await
async function makePreferredLivekitFoci(
rtcSession: MatrixRTCSession,
livekitAlias: string,
@@ -128,13 +129,13 @@ const widgetPostHangupProcedure = async (
// we need to wait until the callEnded event is tracked on posthog.
// Otherwise the iFrame gets killed before the callEnded event got tracked.
await new Promise((resolve) => window.setTimeout(resolve, 10)); // 10ms
widget.api.setAlwaysOnScreen(false);
await widget.api.setAlwaysOnScreen(false);
PosthogAnalytics.instance.logout();
// We send the hangup event after the memberships have been updated
// calling leaveRTCSession.
// We need to wait because this makes the client hosting this widget killing the IFrame.
widget.api.transport.send(ElementWidgetActions.HangupCall, {});
await widget.api.transport.send(ElementWidgetActions.HangupCall, {});
};
export async function leaveRTCSession(