Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Update react-client types
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stasiak committed Jun 13, 2024
1 parent 76cec58 commit b858783
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"preview": "vite preview"
},
"dependencies": {
"@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk",
"@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk#webrtc-errors",
"@mediapipe/tasks-vision": "^0.10.12",
"axios": "^1.6.8",
"chartist": "^1.3.0",
Expand Down
12 changes: 6 additions & 6 deletions assets/src/features/streaming/StreamingErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useToast from "../shared/hooks/useToast";
import { ErrorMessage, messageComparator } from "../../pages/room/errorMessage";
import { PeerMetadata, TrackMetadata, useClient } from "../../fishjam";
import useEffectOnChange from "../shared/hooks/useEffectOnChange";
import { MessageEvents } from "@fishjam-dev/ts-client";
import { ClientEvents } from "@fishjam-dev/react-client";

export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
const { addToast } = useToast();
Expand All @@ -24,26 +24,26 @@ export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
useEffect(() => {
if (!client) return;

const onSocketError: MessageEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
const onSocketError: ClientEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
console.warn(error);
handleError(`Socket error occurred.`, "onSocketError");
};

const onConnectionError: MessageEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error) => {
const onConnectionError: ClientEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error) => {
console.warn(error);
handleError(`Connection error occurred. ${error?.message ?? ""}`);
};

const onJoinError: MessageEvents<PeerMetadata, TrackMetadata>["joinError"] = (event) => {
const onJoinError: ClientEvents<PeerMetadata, TrackMetadata>["joinError"] = (event) => {
console.log(event)
handleError(`Failed to join the room`);
};
const onAuthError: MessageEvents<PeerMetadata, TrackMetadata>["authError"] = (reason) => {
const onAuthError: ClientEvents<PeerMetadata, TrackMetadata>["authError"] = (reason) => {
console.warn(reason);
handleError(`Socket error occurred.`, "onAuthError");
};

const onSocketClose: MessageEvents<PeerMetadata, TrackMetadata>["socketClose"] = (event) => {
const onSocketClose: ClientEvents<PeerMetadata, TrackMetadata>["socketClose"] = (event) => {
console.warn(event);
handleError(`Signaling socket closed.`, "onSocketClose");
};
Expand Down

0 comments on commit b858783

Please sign in to comment.