From 577a6b7c5ab395b786b01b3e33ce69961b2d8f88 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 4 Nov 2022 15:30:25 +0000 Subject: [PATCH] Make SonarCloud happier (#23699) --- src/vector/index.ts | 10 +++++----- src/vector/jitsi/index.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index 5b60f324cd..dd182119d1 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -77,16 +77,16 @@ function checkBrowserFeatures() { const featureList = Object.keys(window.Modernizr); let featureComplete = true; - for (let i = 0; i < featureList.length; i++) { - if (window.Modernizr[featureList[i]] === undefined) { + for (const feature of featureList) { + if (window.Modernizr[feature] === undefined) { logger.error( "Looked for feature '%s' but Modernizr has no results for this. " + - "Has it been configured correctly?", featureList[i], + "Has it been configured correctly?", feature, ); return false; } - if (window.Modernizr[featureList[i]] === false) { - logger.error("Browser missing feature: '%s'", featureList[i]); + if (window.Modernizr[feature] === false) { + logger.error("Browser missing feature: '%s'", feature); // toggle flag rather than return early so we log all missing features rather than just the first. featureComplete = false; } diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index b284cdcaf8..4eda316eec 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -102,7 +102,7 @@ const setupCompleted = (async () => { const handleAction = ( action: WidgetApiAction, - handler: (request: IWidgetApiRequestData) => void, + handler: (request: IWidgetApiRequestData) => Promise, ): void => { widgetApi.on(`action:${action}`, async (ev: CustomEvent) => { ev.preventDefault();