Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: yarn
- name: Build project
env:
VITE_ROOM_MANAGER_URL: ${{ secrets.ROOM_MANAGER_URL }}
VITE_FISHJAM_ID: ${{ vars.FISHJAM_ID }}
run: yarn build
- name: Copy files to deployment server
uses: appleboy/scp-action@v1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"preview": "vite preview"
},
"dependencies": {
"@fishjam-cloud/react-client": "^0.17.0",
"@fishjam-cloud/react-client": "^0.24.0",
"@mediapipe/tasks-vision": "^0.10.22-rc.20250304",
"@radix-ui/react-alert-dialog": "^1.1.14",
"@radix-ui/react-separator": "^1.1.7",
Expand Down
13 changes: 7 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useConnection } from "@fishjam-cloud/react-client";
import { useConnection, useSandbox } from "@fishjam-cloud/react-client";
import RoomView from "./views/RoomView";
import { useParams } from "react-router";
import { useEffect, useMemo } from "react";
import useRoomCredentials from "./hooks/useRoomCredentials";
import TitleBar from "./components/TitleBar";
import Footer from "./components/Footer";
import { Toaster } from "./components/ui/sonner";
Expand All @@ -11,12 +10,14 @@ function App() {
const { joinRoom } = useConnection();
const { room } = useParams();
const peer = useMemo(() => crypto.randomUUID(), []);
const creds = useRoomCredentials(room, peer);
const { getSandboxPeerToken } = useSandbox();

useEffect(() => {
if (!creds) return;
joinRoom({ ...creds, peerMetadata: { name: peer } });
}, [joinRoom, creds, peer]);
if (!room) return;
getSandboxPeerToken(room, peer).then((peerToken) =>
joinRoom({ peerToken, peerMetadata: { name: peer } }),
);
}, [joinRoom, getSandboxPeerToken, room, peer]);

return (
<>
Expand Down
39 changes: 0 additions & 39 deletions src/hooks/useRoomCredentials.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setWasmBundleUrl("/assets/smelter.wasm");

createRoot(document.getElementById("root")!).render(
<StrictMode>
<FishjamProvider>
<FishjamProvider fishjamId={import.meta.env.VITE_FISHJAM_ID}>
<SmelterProvider>
<BrowserRouter>
<Routes>
Expand Down
2 changes: 1 addition & 1 deletion src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface ViteTypeOptions {
}

interface ImportMetaEnv {
readonly VITE_ROOM_MANAGER_URL: string;
readonly VITE_FISHJAM_ID: string;
}

interface ImportMeta {
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,27 @@ __metadata:
languageName: node
linkType: hard

"@fishjam-cloud/react-client@npm:^0.17.0":
version: 0.17.0
resolution: "@fishjam-cloud/react-client@npm:0.17.0"
"@fishjam-cloud/react-client@npm:^0.24.0":
version: 0.24.0
resolution: "@fishjam-cloud/react-client@npm:0.24.0"
dependencies:
"@fishjam-cloud/ts-client": "npm:0.17.0"
"@fishjam-cloud/ts-client": "npm:0.24.0"
events: "npm:3.3.0"
lodash.isequal: "npm:4.5.0"
checksum: 10c0/48c1a9c4f51079d80156cec40eb11867b5af9a568699b76a26909a351445e2bf94835c657a50b68805c01cb8b4e3ec1ffcd8be8ef877dfcd6814a3582e956586
checksum: 10c0/d58e5fd8eee08417f09013de04daf4c707fbb3a75412aa4eb8b50fd7896d1902b065f5f3abc162a7ddb70778ab0e207d2eb72e79973d64ec12200db2e7cf7499
languageName: node
linkType: hard

"@fishjam-cloud/ts-client@npm:0.17.0":
version: 0.17.0
resolution: "@fishjam-cloud/ts-client@npm:0.17.0"
"@fishjam-cloud/ts-client@npm:0.24.0":
version: 0.24.0
resolution: "@fishjam-cloud/ts-client@npm:0.24.0"
dependencies:
"@binbat/whip-whep": "npm:^1.1.1-sdp-trickle-throw"
"@bufbuild/protobuf": "npm:^2.2.3"
events: "npm:^3.3.0"
typed-emitter: "npm:^2.1.0"
uuid: "npm:^11.1.0"
checksum: 10c0/936386b326a69a1a98265020b92d3ba68f7e1a7bced2e72f54efc846e1aa99d1269a59060b24cc2ea85ddd59d6a473609efde269adf26d5c4719b6e9989b9d13
checksum: 10c0/b637bff32bdc89354bbbf828dfbbb4d4fbd7fd87b953d2d3c2b6d36b2c06d7cdb64330d6d10a38d4786d2da4a06c97dcb7a2e407701b8c9edb7bccb2b8972717
languageName: node
linkType: hard

Expand Down Expand Up @@ -2394,7 +2394,7 @@ __metadata:
resolution: "gesture-recognition@workspace:."
dependencies:
"@eslint/js": "npm:^9.22.0"
"@fishjam-cloud/react-client": "npm:^0.17.0"
"@fishjam-cloud/react-client": "npm:^0.24.0"
"@mediapipe/tasks-vision": "npm:^0.10.22-rc.20250304"
"@radix-ui/react-alert-dialog": "npm:^1.1.14"
"@radix-ui/react-separator": "npm:^1.1.7"
Expand Down