From 55f01ee0d5fe15dd47eb6297990970d2a2ab8a9d Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 3 Sep 2024 17:07:43 +0200 Subject: [PATCH] Review https://github.com/element-hq/element-call/pull/2475#pullrequestreview-2175298702 --- src/analytics/PosthogSpanProcessor.ts | 3 +-- src/config/Config.ts | 12 ++++-------- src/rtcSessionHelpers.ts | 4 +--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/analytics/PosthogSpanProcessor.ts b/src/analytics/PosthogSpanProcessor.ts index 5a74aeff..cdc8e4ae 100644 --- a/src/analytics/PosthogSpanProcessor.ts +++ b/src/analytics/PosthogSpanProcessor.ts @@ -161,8 +161,7 @@ export class PosthogSpanProcessor implements SpanProcessor { /** * Shutdown the processor. */ - // eslint-disable-next-line @typescript-eslint/require-await public async shutdown(): Promise { - return; + return Promise.resolve(); } } diff --git a/src/config/Config.ts b/src/config/Config.ts index 342bc2a6..97e7d203 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -35,14 +35,10 @@ export class Config { return Config.internalInstance.initPromise; } Config.internalInstance = new Config(); - Config.internalInstance.initPromise = new Promise( - (resolve, reject) => { - downloadConfig("../config.json") - .then((config) => { - Config.internalInstance.config = { ...DEFAULT_CONFIG, ...config }; - resolve(); - }) - .catch(reject); + + Config.internalInstance.initPromise = downloadConfig("../config.json").then( + (config) => { + Config.internalInstance.config = { ...DEFAULT_CONFIG, ...config }; }, ); return Config.internalInstance.initPromise; diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 32068758..5fdd3c48 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -36,7 +36,6 @@ export function makeActiveFocus(): LivekitFocusActive { }; } -// eslint-disable-next-line @typescript-eslint/require-await async function makePreferredLivekitFoci( rtcSession: MatrixRTCSession, livekitAlias: string, @@ -84,8 +83,7 @@ async function makePreferredLivekitFoci( `No livekit_service_url is configured so we could not create a focus. Currently we skip computing a focus based on other users in the room.`, ); - - return preferredFoci; + return Promise.resolve(preferredFoci); // TODO: we want to do something like this: //