From eba3662f149c29a9b4ade263ef7fac408e03addc Mon Sep 17 00:00:00 2001 From: amar-1995 Date: Wed, 22 May 2024 18:17:39 +0530 Subject: [PATCH] fix: error occured and match removed --- .../components/VideoLayouts/GridLayout.tsx | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/GridLayout.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/GridLayout.tsx index c9eeab1fab..0abc46a6fe 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/GridLayout.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useMemo, useState } from 'react'; import { GridVideoTileLayout } from '@100mslive/types-prebuilt/elements/video_tile_layout'; -import { match } from 'ts-pattern'; import { HMSTranscriptionInfo, selectLocalPeerID, @@ -103,19 +102,12 @@ export const GridLayout = ({ const transcriptionStates: HMSTranscriptionInfo[] | undefined = useHMSStore(selectTranscriptionsState); useEffect(() => { - if (transcriptionStates && transcriptionStates.length > 0) { - match({ state: transcriptionStates[0].state, error: transcriptionStates[0].error }) - .when( - ({ error }) => !!error, - () => { - ToastManager.addToast({ - title: `Failed to enable Closed Caption`, - variant: 'error', - icon: , - }); - }, - ) - .otherwise(() => null); + if (transcriptionStates && transcriptionStates.length > 0 && transcriptionStates[0].error) { + ToastManager.addToast({ + title: `Failed to enable Closed Caption`, + variant: 'error', + icon: , + }); } }, [transcriptionStates]);