@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.
@@ -1,9 +1,9 @@
1
- import { useStore as d } from "@nanostores/react";
2
- import { useRef as y, useState as v, useCallback as I, useEffect as c } from "react";
3
- import { FeatureType as h } from "@streamlayer/sdk-web-types";
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 l } from "../navigation/button/Channels.js";
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 W = (e) => {
17
- const a = y(""), [m, f] = v(!1), A = d(e.status), i = d(e.userId()), r = A === "ready", [s, u] = v(n), p = I(
18
- (t, o) => {
19
- u(o), o === n ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
20
- e.openFeature(h.GAMES);
21
- })) : e.closeFeature(!1);
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
- [e]
23
+ [t]
24
24
  );
25
- c(() => {
26
- !r && s === n && (u(l), e.closeFeature(!0));
27
- }, [r, s, e]);
28
- const g = (t) => {
29
- a.current = t, f(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: S }) => {
30
- if (S) {
31
- p(t, l);
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
- e.isUserAuthorized().then((E) => {
36
- if (E) {
37
- p(t, n);
35
+ t.isUserAuthorized().then((g) => {
36
+ if (g) {
37
+ p(e, n);
38
38
  return;
39
39
  } else
40
- e.disableApp();
40
+ t.disableApp();
41
41
  });
42
42
  return;
43
43
  }
44
44
  });
45
- }, b = () => {
46
- f(!1), e.disableApp();
45
+ }, E = () => {
46
+ f(!1), t.disableApp();
47
47
  };
48
- return c(() => {
49
- if (!i) {
50
- r && (u(l), e.disableApp());
48
+ return v(() => {
49
+ if (!r) {
50
+ i && (u(c), t.disableApp());
51
51
  return;
52
52
  }
53
- if (i && a.current && m) {
54
- e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
55
- e.createEventSession(a.current);
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
- }, [i]), c(() => {
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: r,
61
+ sdkReady: i,
65
62
  activeOverlay: s,
66
63
  activateAndLoadOverlay: p,
67
- activateEventWithId: g,
68
- deactivate: b,
69
- isLogged: !!i
64
+ activateEventWithId: S,
65
+ deactivate: E,
66
+ isLogged: !!r
70
67
  };
71
68
  };
72
69
  export {
73
- W as useMastersApp
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.0",
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.0",
47
- "@streamlayer/sdk-web": "^0.31.1",
48
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.36",
49
- "@streamlayer/sdk-web-api": "^0.21.1",
50
- "@streamlayer/sdk-web-core": "^0.20.0",
51
- "@streamlayer/sdk-web-features": "^0.11.18",
52
- "@streamlayer/sdk-web-interfaces": "^0.20.3",
53
- "@streamlayer/sdk-web-logger": "^0.5.14",
54
- "@streamlayer/sdk-web-notifications": "^0.13.9",
55
- "@streamlayer/sdk-web-storage": "^0.4.1",
56
- "@streamlayer/sdk-web-types": "^0.22.1"
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.0"
97
+ "@streamlayer/react": "^0.39.1"
98
98
  }
99
99
  }