@stream-io/video-react-bindings 0.0.12 → 0.0.14
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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.14](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.13...@stream-io/video-react-bindings-0.0.14) (2023-06-15)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@stream-io/video-client` updated to version `0.0.1`
|
|
10
|
+
### [0.0.13](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.12...@stream-io/video-react-bindings-0.0.13) (2023-06-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Update React sample apps for new connect flow ([#637](https://github.com/GetStream/stream-video-js/issues/637)) ([4f71f01](https://github.com/GetStream/stream-video-js/commit/4f71f01c882f350f67df03a4b06f214b06746460))
|
|
16
|
+
|
|
5
17
|
### [0.0.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.11...@stream-io/video-react-bindings-0.0.12) (2023-06-13)
|
|
6
18
|
|
|
7
19
|
### Dependency Updates
|
|
@@ -11,11 +11,6 @@ const StreamVideoContext = createContext(undefined);
|
|
|
11
11
|
export const StreamVideo = ({ children, client, i18nInstance, language, translationsOverrides, }) => {
|
|
12
12
|
const prevClient = useRef(undefined);
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
if (prevClient.current) {
|
|
15
|
-
prevClient.current
|
|
16
|
-
.disconnectUser()
|
|
17
|
-
.catch((error) => console.error(`Failed to disconnect`, error));
|
|
18
|
-
}
|
|
19
14
|
if (client.user) {
|
|
20
15
|
client
|
|
21
16
|
.connectUser()
|
|
@@ -23,9 +18,8 @@ export const StreamVideo = ({ children, client, i18nInstance, language, translat
|
|
|
23
18
|
}
|
|
24
19
|
prevClient.current = client;
|
|
25
20
|
return () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.catch((error) => console.error(`Failed to disconnect`, error));
|
|
21
|
+
var _a;
|
|
22
|
+
(_a = prevClient.current) === null || _a === void 0 ? void 0 : _a.disconnectUser().catch((error) => console.error(`Failed to disconnect`, error));
|
|
29
23
|
};
|
|
30
24
|
}, [client]);
|
|
31
25
|
return (_jsx(StreamVideoContext.Provider, Object.assign({ value: client }, { children: _jsx(StreamI18nProvider, Object.assign({ i18nInstance: i18nInstance, language: language, translationsOverrides: translationsOverrides }, { children: children })) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamVideoContext.js","sourceRoot":"","sources":["../../../src/contexts/StreamVideoContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EAEb,UAAU,EACV,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,kBAAkB,GAAG,aAAa,CACtC,SAAS,CACV,CAAC;AAUF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,qBAAqB,GACe,EAAE,EAAE;IACxC,MAAM,UAAU,GAAG,MAAM,CAAgC,SAAS,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,
|
|
1
|
+
{"version":3,"file":"StreamVideoContext.js","sourceRoot":"","sources":["../../../src/contexts/StreamVideoContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EAEb,UAAU,EACV,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,kBAAkB,GAAG,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|
+
"@stream-io/video-client": "^0.0.13",
|
|
28
28
|
"react": ">=17.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@stream-io/i18n": "^0.0.3",
|
|
32
|
-
"@stream-io/video-client": "^0.0.
|
|
32
|
+
"@stream-io/video-client": "^0.0.13",
|
|
33
33
|
"@types/react": "^18.0.26",
|
|
34
34
|
"@types/rimraf": "^3.0.2",
|
|
35
35
|
"react": "^18.2.0",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"typedoc-plugin-markdown": "^3.15.3",
|
|
40
40
|
"typescript": "^4.9.5"
|
|
41
41
|
},
|
|
42
|
-
"version": "0.0.
|
|
42
|
+
"version": "0.0.14"
|
|
43
43
|
}
|
|
@@ -39,12 +39,6 @@ export const StreamVideo = ({
|
|
|
39
39
|
const prevClient = useRef<StreamVideoClient | undefined>(undefined);
|
|
40
40
|
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
if (prevClient.current) {
|
|
43
|
-
prevClient.current
|
|
44
|
-
.disconnectUser()
|
|
45
|
-
.catch((error) => console.error(`Failed to disconnect`, error));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
42
|
if (client.user) {
|
|
49
43
|
client
|
|
50
44
|
.connectUser()
|
|
@@ -56,8 +50,8 @@ export const StreamVideo = ({
|
|
|
56
50
|
prevClient.current = client;
|
|
57
51
|
|
|
58
52
|
return () => {
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
prevClient.current
|
|
54
|
+
?.disconnectUser()
|
|
61
55
|
.catch((error) => console.error(`Failed to disconnect`, error));
|
|
62
56
|
};
|
|
63
57
|
}, [client]);
|