Skip to content

Commit

Permalink
fix: added saved-prod-id when manually adding id, removed unused call…
Browse files Browse the repository at this point in the history
…-saved-prod-id from globalstate
  • Loading branch information
malmen237 committed Dec 2, 2024
1 parent 912ed19 commit ec555db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
10 changes: 1 addition & 9 deletions src/components/calls-page/calls-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,14 @@ export const CallsPage = () => {
if (selectedProductionId) {
setProductionId(selectedProductionId);
}
}, [selectedProductionId, dispatch]);
}, [selectedProductionId]);

useEffect(() => {
if (isEmpty && !paramProductionId && !paramLineId) {
navigate("/");
}
}, [isEmpty, paramProductionId, paramLineId, navigate]);

useEffect(() => {
console.log("productionId", productionId);
}, [productionId]);

useEffect(() => {
console.log("addCallActive", addCallActive);
}, [addCallActive]);

const runExitAllCalls = async () => {
setProductionId(null);
Object.entries(calls).forEach(([callId]) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ErrorBanner: FC = () => {
if (error.callErrors) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Object.entries(error.callErrors).forEach(([_, singleError]) => {
// _ is needed to destructure the object
if (singleError && !displayedMessages.has(singleError.message)) {
console.error(`Error:`, singleError.message); // Display only unique errors
displayedMessages.add(singleError.message);
Expand Down
6 changes: 5 additions & 1 deletion src/components/landing-page/join-production.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ export const JoinProduction = ({
window.localStorage?.setItem("username", payload.username);
}

dispatch({
type: "SELECT_PRODUCTION_ID",
payload: payload.productionId,
});

const uuid = uuidv4();

dispatch({
Expand All @@ -143,7 +148,6 @@ export const JoinProduction = ({
mediaStreamInput: null,
dominantSpeaker: null,
audioLevelAboveThreshold: false,
selectedProductionId: null,
},
},
});
Expand Down
1 change: 0 additions & 1 deletion src/global-state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface CallState {
mediaStreamInput: MediaStream | null;
dominantSpeaker: string | null;
audioLevelAboveThreshold: boolean;
selectedProductionId: string | null;
}

export type TGlobalState = {
Expand Down

0 comments on commit ec555db

Please sign in to comment.