Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breakout Rooms] Ensure that waiting room cannot be rendered multiple times on the page #238

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion examples/breakout-rooms/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,28 @@

const App: React.FC = () => {
const { isFacilitator, breakout } = useBreakout();
const [waitingRoomRendered, setWaitingRoomRendered] = React.useState(false);

const areYouReady = isFacilitator || !breakout;

const renderWaitingRoom = () => {
if (!waitingRoomRendered) {
setWaitingRoomRendered(true);
}
};

return (
<ErrorBoundary>
<MiroProvider>
{areYouReady ? <BreakoutManager /> : <WaitingRoom />}
{areYouReady ? <BreakoutManager /> : null}
{!areYouReady && !waitingRoomRendered ? (
<WaitingRoom onRender={renderWaitingRoom} />
) : null}
</MiroProvider>
</ErrorBoundary>
);
};

const container = document.getElementById("root")!;

Check warning on line 36 in examples/breakout-rooms/src/app.tsx

View workflow job for this annotation

GitHub Actions / Run linters

Forbidden non-null assertion
const root = createRoot(container);
root.render(<App />);
Loading