@stream-io/video-react-sdk 1.32.2 → 1.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,6 @@ import { MouseEventHandler } from 'react';
2
2
  export type AcceptCallButtonProps = {
3
3
  disabled?: boolean;
4
4
  onClick?: MouseEventHandler<HTMLButtonElement>;
5
- onAccept?: () => void;
5
+ onAccept?: (err?: Error) => void;
6
6
  };
7
7
  export declare const AcceptCallButton: ({ disabled, onAccept, onClick, }: AcceptCallButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export type CallControlsProps = {
2
- onLeave?: () => void;
2
+ onLeave?: (err?: Error) => void;
3
3
  };
4
4
  export declare const CallControls: ({ onLeave }: CallControlsProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ export type CancelCallButtonProps = {
3
3
  disabled?: boolean;
4
4
  caption?: string;
5
5
  onClick?: MouseEventHandler<HTMLButtonElement>;
6
- onLeave?: () => void;
6
+ onLeave?: (err?: Error) => void;
7
7
  };
8
8
  export declare const CancelCallConfirmButton: ({ onClick, onLeave, }: CancelCallButtonProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export declare const CancelCallButton: ({ disabled, caption, onClick, onLeave, }: CancelCallButtonProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "1.32.2",
3
+ "version": "1.32.4",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@floating-ui/react": "^0.27.6",
34
- "@stream-io/video-client": "1.42.2",
34
+ "@stream-io/video-client": "1.43.0",
35
35
  "@stream-io/video-filters-web": "0.7.2",
36
- "@stream-io/video-react-bindings": "1.13.6",
36
+ "@stream-io/video-react-bindings": "1.13.8",
37
37
  "chart.js": "^4.4.4",
38
38
  "clsx": "^2.0.0",
39
39
  "react-chartjs-2": "^5.3.0"
@@ -5,7 +5,7 @@ import { useCall } from '@stream-io/video-react-bindings';
5
5
  export type AcceptCallButtonProps = {
6
6
  disabled?: boolean;
7
7
  onClick?: MouseEventHandler<HTMLButtonElement>;
8
- onAccept?: () => void;
8
+ onAccept?: (err?: Error) => void;
9
9
  };
10
10
 
11
11
  export const AcceptCallButton = ({
@@ -19,8 +19,13 @@ export const AcceptCallButton = ({
19
19
  if (onClick) {
20
20
  onClick(e);
21
21
  } else if (call) {
22
- await call.join();
23
- onAccept?.();
22
+ try {
23
+ await call.join();
24
+ onAccept?.();
25
+ } catch (err) {
26
+ console.error(`Failed to accept call`, err);
27
+ onAccept?.(err as Error);
28
+ }
24
29
  }
25
30
  },
26
31
  [onClick, onAccept, call],
@@ -12,7 +12,7 @@ import { ToggleVideoPublishingButton } from './ToggleVideoButton';
12
12
  import { CancelCallButton } from './CancelCallButton';
13
13
 
14
14
  export type CallControlsProps = {
15
- onLeave?: () => void;
15
+ onLeave?: (err?: Error) => void;
16
16
  };
17
17
 
18
18
  export const CallControls = ({ onLeave }: CallControlsProps) => (
@@ -67,7 +67,7 @@ export type CancelCallButtonProps = {
67
67
  disabled?: boolean;
68
68
  caption?: string;
69
69
  onClick?: MouseEventHandler<HTMLButtonElement>;
70
- onLeave?: () => void;
70
+ onLeave?: (err?: Error) => void;
71
71
  };
72
72
 
73
73
  export const CancelCallConfirmButton = ({
@@ -81,8 +81,13 @@ export const CancelCallConfirmButton = ({
81
81
  if (onClick) {
82
82
  onClick(e);
83
83
  } else if (call) {
84
- await call.leave();
85
- onLeave?.();
84
+ try {
85
+ await call.leave();
86
+ onLeave?.();
87
+ } catch (err) {
88
+ console.error(`Failed to leave call`, err);
89
+ onLeave?.(err as Error);
90
+ }
86
91
  }
87
92
  },
88
93
  [onClick, onLeave, call],
@@ -93,8 +98,13 @@ export const CancelCallConfirmButton = ({
93
98
  if (onClick) {
94
99
  onClick(e);
95
100
  } else if (call) {
96
- await call.endCall();
97
- onLeave?.();
101
+ try {
102
+ await call.endCall();
103
+ onLeave?.();
104
+ } catch (err) {
105
+ console.error(`Failed to end call`, err);
106
+ onLeave?.(err as Error);
107
+ }
98
108
  }
99
109
  },
100
110
  [onClick, onLeave, call],
@@ -120,8 +130,13 @@ export const CancelCallButton = ({
120
130
  if (onClick) {
121
131
  onClick(e);
122
132
  } else if (call) {
123
- await call.leave();
124
- onLeave?.();
133
+ try {
134
+ await call.leave();
135
+ onLeave?.();
136
+ } catch (err) {
137
+ console.error(`Failed to leave call`, err);
138
+ onLeave?.(err as Error);
139
+ }
125
140
  }
126
141
  },
127
142
  [onClick, onLeave, call],
@@ -20,7 +20,9 @@ export const RingingCallControls = () => {
20
20
  <CancelCallButton
21
21
  onClick={() => {
22
22
  const reason = call.isCreatedByMe ? 'cancel' : 'decline';
23
- call.leave({ reject: true, reason });
23
+ call.leave({ reject: true, reason }).catch((err) => {
24
+ console.error(`Failed to reject`, err);
25
+ });
24
26
  }}
25
27
  disabled={buttonsDisabled}
26
28
  />