Skip to content

Commit

Permalink
fix: restrict transcription to a single room
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored May 30, 2023
1 parent 9f1d9d1 commit 0c84d47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions apps/100ms-web/src/services/FeatureFlags.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect } from "react";
import { selectRoomID, useHMSStore } from "@100mslive/react-sdk";

export class FeatureFlags {
static enableTranscription =
Expand All @@ -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 = {};
}
Expand All @@ -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() {
Expand All @@ -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;
}

0 comments on commit 0c84d47

Please sign in to comment.