@streamlayer/react-ui 0.95.0 → 0.95.1
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/lib/ui/app/useMastersApp.js +36 -39
- package/package.json +13 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { FeatureType as
|
|
1
|
+
import { useStore as l } from "@nanostores/react";
|
|
2
|
+
import { useRef as h, useState as d, useCallback as F, useEffect as v } from "react";
|
|
3
|
+
import { FeatureType as y } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "./Navigation/MastersNavigation/index.js";
|
|
5
5
|
import { FeaturedGroupsButtonId as n } from "../navigation/button/FeaturedGroups.js";
|
|
6
|
-
import { ChannelsButtonId as
|
|
6
|
+
import { ChannelsButtonId as c } from "../navigation/button/Channels.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../navigation/button/LeaderBoard.js";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -13,62 +13,59 @@ import "../navigation/button/styles.js";
|
|
|
13
13
|
import "../navigation/masters.js";
|
|
14
14
|
import "../navigation/index.js";
|
|
15
15
|
import "../theme/constants.js";
|
|
16
|
-
const
|
|
17
|
-
const a =
|
|
18
|
-
(
|
|
19
|
-
u(o), o === n ? (
|
|
20
|
-
|
|
21
|
-
})) :
|
|
16
|
+
const j = (t) => {
|
|
17
|
+
const a = h(""), [m, f] = d(!1), A = l(t.status), r = l(t.userId()), i = A === "ready", [s, u] = d(n), p = F(
|
|
18
|
+
(e, o) => {
|
|
19
|
+
u(o), o === n ? (e && t.createEventSession(e), window.requestAnimationFrame(() => {
|
|
20
|
+
t.openFeature(y.GAMES);
|
|
21
|
+
})) : t.closeFeature(!1);
|
|
22
22
|
},
|
|
23
|
-
[
|
|
23
|
+
[t]
|
|
24
24
|
);
|
|
25
|
-
|
|
26
|
-
!
|
|
27
|
-
}, [
|
|
28
|
-
const
|
|
29
|
-
a.current =
|
|
30
|
-
if (
|
|
31
|
-
p(
|
|
25
|
+
v(() => {
|
|
26
|
+
!i && s === n && (u(c), t.closeFeature(!0));
|
|
27
|
+
}, [i, s, t]);
|
|
28
|
+
const S = (e) => {
|
|
29
|
+
a.current = e, f(!0), t.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: b }) => {
|
|
30
|
+
if (b) {
|
|
31
|
+
p(e, c);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
if (o) {
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
p(
|
|
35
|
+
t.isUserAuthorized().then((g) => {
|
|
36
|
+
if (g) {
|
|
37
|
+
p(e, n);
|
|
38
38
|
return;
|
|
39
39
|
} else
|
|
40
|
-
|
|
40
|
+
t.disableApp();
|
|
41
41
|
});
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
},
|
|
46
|
-
f(!1),
|
|
45
|
+
}, E = () => {
|
|
46
|
+
f(!1), t.disableApp();
|
|
47
47
|
};
|
|
48
|
-
return
|
|
49
|
-
if (!
|
|
50
|
-
|
|
48
|
+
return v(() => {
|
|
49
|
+
if (!r) {
|
|
50
|
+
i && (u(c), t.disableApp());
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (r && a.current && m) {
|
|
54
|
+
t.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
|
|
55
|
+
t.createEventSession(a.current);
|
|
56
56
|
});
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
}, [
|
|
60
|
-
const t = e.getInviterId();
|
|
61
|
-
console.log("you invited by", t), t && e.status.get() === "disabled" && (console.log("deep link cb called"), e.deepLinkHandled());
|
|
62
|
-
}, [e]), {
|
|
59
|
+
}, [r]), {
|
|
63
60
|
sdkEnabled: m,
|
|
64
|
-
sdkReady:
|
|
61
|
+
sdkReady: i,
|
|
65
62
|
activeOverlay: s,
|
|
66
63
|
activateAndLoadOverlay: p,
|
|
67
|
-
activateEventWithId:
|
|
68
|
-
deactivate:
|
|
69
|
-
isLogged: !!
|
|
64
|
+
activateEventWithId: S,
|
|
65
|
+
deactivate: E,
|
|
66
|
+
isLogged: !!r
|
|
70
67
|
};
|
|
71
68
|
};
|
|
72
69
|
export {
|
|
73
|
-
|
|
70
|
+
j as useMastersApp
|
|
74
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
44
44
|
"react-window": "^1.8.10",
|
|
45
45
|
"react-window-infinite-loader": "^1.0.9",
|
|
46
|
-
"@streamlayer/feature-gamification": "^0.37.
|
|
47
|
-
"@streamlayer/sdk-web": "^0.31.
|
|
48
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
49
|
-
"@streamlayer/sdk-web-api": "^0.21.
|
|
50
|
-
"@streamlayer/sdk-web-core": "^0.20.
|
|
51
|
-
"@streamlayer/sdk-web-features": "^0.11.
|
|
52
|
-
"@streamlayer/sdk-web-interfaces": "^0.20.
|
|
53
|
-
"@streamlayer/sdk-web-logger": "^0.5.
|
|
54
|
-
"@streamlayer/sdk-web-notifications": "^0.13.
|
|
55
|
-
"@streamlayer/sdk-web-storage": "^0.4.
|
|
56
|
-
"@streamlayer/sdk-web-types": "^0.22.
|
|
46
|
+
"@streamlayer/feature-gamification": "^0.37.1",
|
|
47
|
+
"@streamlayer/sdk-web": "^0.31.2",
|
|
48
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.37",
|
|
49
|
+
"@streamlayer/sdk-web-api": "^0.21.2",
|
|
50
|
+
"@streamlayer/sdk-web-core": "^0.20.1",
|
|
51
|
+
"@streamlayer/sdk-web-features": "^0.11.19",
|
|
52
|
+
"@streamlayer/sdk-web-interfaces": "^0.20.4",
|
|
53
|
+
"@streamlayer/sdk-web-logger": "^0.5.15",
|
|
54
|
+
"@streamlayer/sdk-web-notifications": "^0.13.10",
|
|
55
|
+
"@streamlayer/sdk-web-storage": "^0.4.2",
|
|
56
|
+
"@streamlayer/sdk-web-types": "^0.22.2"
|
|
57
57
|
},
|
|
58
58
|
"nx": {
|
|
59
59
|
"implicitDependencies": [
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
"vite-plugin-svgr": "^4.2.0",
|
|
95
95
|
"vite-svg-loader": "^5.1.0",
|
|
96
96
|
"vite-tsconfig-paths": "^4.3.1",
|
|
97
|
-
"@streamlayer/react": "^0.39.
|
|
97
|
+
"@streamlayer/react": "^0.39.1"
|
|
98
98
|
}
|
|
99
99
|
}
|