diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index c61966830b..f35ee216a6 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -40,6 +40,7 @@ jobs: REACT_APP_TRANSCRIPTION_PUSHER_AUTHENDPOINT: 'https://whiteboard-server.vercel.app/api/pusher/auth' REACT_APP_TRANSCRIPTION_PUSHER_APP_KEY: ${{ secrets.PUSHER_KEY }} REACT_APP_DYNAMIC_STT_TOKEN_GENERATION_ENDPOINT: ${{ secrets.ASSEMBLY_AI_TOKEN_ENDPOINT }} + REACT_APP_TRANSCRIPTION_ROOM_ID: "644df1027cebfa471fcc52fd" steps: - name: log inputs diff --git a/apps/100ms-web/src/services/FeatureFlags.jsx b/apps/100ms-web/src/services/FeatureFlags.jsx index dd45317858..f45be0431e 100644 --- a/apps/100ms-web/src/services/FeatureFlags.jsx +++ b/apps/100ms-web/src/services/FeatureFlags.jsx @@ -1,4 +1,5 @@ import { useEffect } from "react"; +import { selectRoomID, useHMSStore } from "@100mslive/react-sdk"; export class FeatureFlags { static enableTranscription = @@ -12,7 +13,7 @@ export class FeatureFlags { static enableBeamSpeakersLogging = process.env.REACT_APP_ENABLE_BEAM_SPEAKERS_LOGGING === "true"; - static init() { + static init(roomId) { if (!window.HMS) { window.HMS = {}; } @@ -21,6 +22,9 @@ export class FeatureFlags { // ask permissions in preview even if role doesn't have it window.HMS.ALWAYS_REQUEST_PERMISSIONS = false; window.HMS.SHOW_NS = process.env.REACT_APP_ENV !== "prod"; + + this.enableTranscription = + process.env.REACT_APP_TRANSCRIPTION_ROOM_ID === roomId; } static showNS() { @@ -37,8 +41,11 @@ export class FeatureFlags { } export function FeatureFlagsInit() { + const roomId = useHMSStore(selectRoomID); useEffect(() => { - FeatureFlags.init(); - }, []); + if (roomId) { + FeatureFlags.init(roomId); + } + }, [roomId]); return null; }