From ab457be4bbffec68f8055ce52eeca15b18b1e7a6 Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 3 Sep 2024 17:11:52 +0200 Subject: [PATCH] additional lint fixes --- src/grid/Grid.tsx | 4 ++-- src/home/CallList.test.tsx | 2 +- src/room/MuteStates.ts | 13 +++++++++---- src/vitest.setup.ts | 18 +++++++++++------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/grid/Grid.tsx b/src/grid/Grid.tsx index c524d928..801ba064 100644 --- a/src/grid/Grid.tsx +++ b/src/grid/Grid.tsx @@ -362,7 +362,7 @@ export function Grid< // Because we're using react-spring in imperative mode, we're responsible for // firing animations manually whenever the tiles array updates useEffect(() => { - springRef.start(); + void springRef.start(); }, [placedTiles, springRef]); const animateDraggedTile = ( @@ -372,7 +372,7 @@ export function Grid< const { tileId, tileX, tileY } = dragState.current!; const tile = placedTiles.find((t) => t.id === tileId)!; - springRef.current + void springRef.current .find((c) => (c.item as Tile).id === tileId) ?.start( endOfGesture diff --git a/src/home/CallList.test.tsx b/src/home/CallList.test.tsx index 4b090d22..fff5017b 100644 --- a/src/home/CallList.test.tsx +++ b/src/home/CallList.test.tsx @@ -31,7 +31,7 @@ describe("CallList", () => { ); }; - it("should show room", async () => { + it("should show room", () => { const rooms = [ { roomName: "Room #1", diff --git a/src/room/MuteStates.ts b/src/room/MuteStates.ts index 8ec58265..8e6b8d7c 100644 --- a/src/room/MuteStates.ts +++ b/src/room/MuteStates.ts @@ -22,6 +22,7 @@ import { useMemo, } from "react"; import { IWidgetApiRequest } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; import { MediaDevice, useMediaDevices } from "../livekit/MediaDevicesContext"; import { useReactiveState } from "../useReactiveState"; @@ -83,10 +84,14 @@ export function useMuteStates(): MuteStates { const video = useMuteState(devices.videoInput, () => true); useEffect(() => { - widget?.api.transport.send(ElementWidgetActions.DeviceMute, { - audio_enabled: audio.enabled, - video_enabled: video.enabled, - }); + widget?.api.transport + .send(ElementWidgetActions.DeviceMute, { + audio_enabled: audio.enabled, + video_enabled: video.enabled, + }) + .catch((e) => + logger.warn("Could not send DeviceMute action to widget", e), + ); }, [audio, video]); const onMuteStateChangeRequest = useCallback( diff --git a/src/vitest.setup.ts b/src/vitest.setup.ts index e4210b7c..9b6a7891 100644 --- a/src/vitest.setup.ts +++ b/src/vitest.setup.ts @@ -20,17 +20,21 @@ import posthog from "posthog-js"; import { initReactI18next } from "react-i18next"; import { afterEach, beforeEach } from "vitest"; import { cleanup } from "@testing-library/react"; +import { logger } from "matrix-js-sdk/src/logger"; import { Config } from "./config/Config"; // Bare-minimum i18n config -i18n.use(initReactI18next).init({ - lng: "en-GB", - fallbackLng: "en-GB", - interpolation: { - escapeValue: false, // React has built-in XSS protections - }, -}); +i18n + .use(initReactI18next) + .init({ + lng: "en-GB", + fallbackLng: "en-GB", + interpolation: { + escapeValue: false, // React has built-in XSS protections + }, + }) + .catch((e) => logger.warn("Failed to init i18n for testing", e)); Config.initDefault(); posthog.opt_out_capturing();