@streamlayer/react 1.14.3 → 1.14.5
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/cjs/advertisement.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/index2.js +5 -5
- package/lib/cjs/masters2.js +8 -3
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/provider.js +32 -16
- package/lib/cjs/useStreamLayerApp2.js +2 -2
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/index2.js +5 -5
- package/lib/classic/cjs/masters2.js +8 -3
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/provider.js +32 -16
- package/lib/classic/cjs/useStreamLayerApp2.js +2 -2
- package/lib/classic/es/advertisement.js +3 -3
- package/lib/classic/es/bet-pack.js +5 -5
- package/lib/classic/es/index.js +4 -4
- package/lib/classic/es/index2.js +1228 -1344
- package/lib/classic/es/masters2.js +404 -399
- package/lib/classic/es/notification.js +42 -40
- package/lib/classic/es/provider.js +3847 -3786
- package/lib/classic/es/useStreamLayerApp2.js +65 -49
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/masters.js +48 -27
- package/lib/dist/es/masters.js +11377 -11416
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +3 -3
- package/lib/es/bet-pack.js +5 -5
- package/lib/es/index.js +4 -4
- package/lib/es/index2.js +1228 -1344
- package/lib/es/masters2.js +404 -399
- package/lib/es/notification.js +42 -40
- package/lib/es/provider.js +3844 -3783
- package/lib/es/useStreamLayerApp2.js +65 -49
- package/lib/style.css +1 -1
- package/package.json +14 -14
|
@@ -13748,7 +13748,10 @@ const jk = (e, t, n) => {
|
|
|
13748
13748
|
fetcher: async (c, l, m, u, d) => {
|
|
13749
13749
|
var T;
|
|
13750
13750
|
if (!m || !u || !d)
|
|
13751
|
-
return
|
|
13751
|
+
return {
|
|
13752
|
+
timestamp: Date.now(),
|
|
13753
|
+
data: null
|
|
13754
|
+
};
|
|
13752
13755
|
const y = await o.betPack({
|
|
13753
13756
|
eventId: m,
|
|
13754
13757
|
types: [M.PREDICTION],
|
|
@@ -13759,24 +13762,30 @@ const jk = (e, t, n) => {
|
|
|
13759
13762
|
order: "asc"
|
|
13760
13763
|
}
|
|
13761
13764
|
});
|
|
13762
|
-
return !y.data || !y.data.length ?
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13765
|
+
return !y.data || !y.data.length ? {
|
|
13766
|
+
timestamp: Date.now(),
|
|
13767
|
+
data: null
|
|
13768
|
+
} : {
|
|
13769
|
+
timestamp: Date.now(),
|
|
13770
|
+
data: (T = y.data) == null ? void 0 : T.reduce((g, f) => {
|
|
13771
|
+
var O;
|
|
13772
|
+
const _ = (O = f == null ? void 0 : f.attributes) == null ? void 0 : O.question;
|
|
13773
|
+
if (!(_ != null && _.id))
|
|
13774
|
+
return g;
|
|
13775
|
+
const h = {
|
|
13776
|
+
eventId: m,
|
|
13777
|
+
userId: u,
|
|
13778
|
+
organizationId: d
|
|
13779
|
+
};
|
|
13780
|
+
return a.isBetPackQuestionReceived(h, _.id) || (ae.emit("poll", {
|
|
13781
|
+
action: "received",
|
|
13782
|
+
payload: {
|
|
13783
|
+
questionId: _.id,
|
|
13784
|
+
questionType: _.type
|
|
13785
|
+
}
|
|
13786
|
+
}), a.saveBetPackQuestionReceived(h, _.id)), { ...g, [_.id]: _ };
|
|
13787
|
+
}, {})
|
|
13788
|
+
};
|
|
13780
13789
|
},
|
|
13781
13790
|
dedupeTime: 0,
|
|
13782
13791
|
refetchInterval: 0
|
|
@@ -14087,39 +14096,45 @@ class mh {
|
|
|
14087
14096
|
const n = !!t.sdk.options.get().betPack;
|
|
14088
14097
|
this.feedList = new we(eh(this.slStreamId, this.interactiveAllowed, n, t.transport), "gamification:feedList"), this.betPack = new we(nh(this.slStreamId, this.userId, this.organizationId, this.storage, t.transport), "gamification:betPack"), this.activeQuestionId = zk(this.slStreamId, n, t.transport), this.openedQuestion = ah(t.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((a) => {
|
|
14089
14098
|
this.log.debug({ item: a }, "received question"), a != null && a.questionId ? (this.questionSubscription = Zk(a.questionId, t.transport), this.questionSubscription.addListener("feed-subscription-opened-question", async (s) => {
|
|
14090
|
-
var r, c;
|
|
14099
|
+
var r, c, l;
|
|
14091
14100
|
const o = (c = (r = s.data) == null ? void 0 : r.attributes) == null ? void 0 : c.question;
|
|
14092
14101
|
if (this.openedQuestion.updateExtendedQuestion(o), (o == null ? void 0 : o.type) === M.PREDICTION && (o.status === Z.ACTIVE || o.status === Z.RESOLVED)) {
|
|
14093
|
-
const l = this.betPack.getValues().data || {};
|
|
14094
|
-
if (
|
|
14095
|
-
const
|
|
14102
|
+
const m = ((l = this.betPack.getValues().data) == null ? void 0 : l.data) || {};
|
|
14103
|
+
if (m != null && m[o.id] || Object.keys(m).length < 5) {
|
|
14104
|
+
const u = Dt(o.id, this.transport), d = u.subscribe(() => {
|
|
14096
14105
|
});
|
|
14097
|
-
await
|
|
14098
|
-
let
|
|
14099
|
-
|
|
14100
|
-
|
|
14106
|
+
await u.get().promise;
|
|
14107
|
+
let y = u.get().data;
|
|
14108
|
+
y || (y = await ts(o.id, this.transport)), d(), window.requestAnimationFrame(() => {
|
|
14109
|
+
u.invalidate();
|
|
14101
14110
|
}), this.betPack.getStore().mutate({
|
|
14102
|
-
|
|
14103
|
-
|
|
14111
|
+
timestamp: Date.now(),
|
|
14112
|
+
data: {
|
|
14113
|
+
...m,
|
|
14114
|
+
[o.id]: y
|
|
14115
|
+
}
|
|
14104
14116
|
});
|
|
14105
14117
|
}
|
|
14106
14118
|
}
|
|
14107
14119
|
}), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (t.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
|
|
14108
14120
|
})), this.feedSubscription = Xk(this.slStreamId, t.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (a) => {
|
|
14109
|
-
var o, r;
|
|
14121
|
+
var o, r, c;
|
|
14110
14122
|
const s = (r = (o = a.data) == null ? void 0 : o.attributes) == null ? void 0 : r.question;
|
|
14111
14123
|
if ((s == null ? void 0 : s.type) === M.PREDICTION && (s.status === Z.ACTIVE || s.status === Z.RESOLVED)) {
|
|
14112
|
-
const c = this.betPack.getValues().data || {};
|
|
14113
|
-
if (
|
|
14114
|
-
const
|
|
14124
|
+
const l = ((c = this.betPack.getValues().data) == null ? void 0 : c.data) || {};
|
|
14125
|
+
if (l != null && l[s.id] || Object.keys(l).length < 5) {
|
|
14126
|
+
const m = Dt(s.id, this.transport), u = m.subscribe(() => {
|
|
14115
14127
|
});
|
|
14116
|
-
await
|
|
14117
|
-
let
|
|
14118
|
-
|
|
14119
|
-
|
|
14128
|
+
await m.get().promise;
|
|
14129
|
+
let d = m.get().data;
|
|
14130
|
+
d || (d = await ts(s.id, this.transport)), u(), window.requestAnimationFrame(() => {
|
|
14131
|
+
m.invalidate();
|
|
14120
14132
|
}), this.betPack.getStore().mutate({
|
|
14121
|
-
|
|
14122
|
-
|
|
14133
|
+
timestamp: Date.now(),
|
|
14134
|
+
data: {
|
|
14135
|
+
...l,
|
|
14136
|
+
[s.id]: d
|
|
14137
|
+
}
|
|
14123
14138
|
});
|
|
14124
14139
|
}
|
|
14125
14140
|
}
|
|
@@ -15137,27 +15152,28 @@ class Ch extends rc {
|
|
|
15137
15152
|
this.background.feedSubscription.removeListener("feed-subscription-prediction-close"), this.background.feedSubscription.removeListener("feed-subscription-questions-list");
|
|
15138
15153
|
});
|
|
15139
15154
|
p(this, "betPackVote", async (n, a) => {
|
|
15155
|
+
var r;
|
|
15140
15156
|
try {
|
|
15141
15157
|
await dr(this.transport, { questionId: n, answerId: a });
|
|
15142
|
-
} catch (
|
|
15143
|
-
if (
|
|
15144
|
-
const
|
|
15158
|
+
} catch (c) {
|
|
15159
|
+
if (c.message === Vt.ALREADY_VOTED) {
|
|
15160
|
+
const l = Dt(n, this.transport), m = l.subscribe(() => {
|
|
15145
15161
|
});
|
|
15146
|
-
|
|
15162
|
+
l.invalidate(), m();
|
|
15147
15163
|
}
|
|
15148
|
-
throw
|
|
15164
|
+
throw c;
|
|
15149
15165
|
}
|
|
15150
|
-
const s = { ...this.betPack.getValues().data }, o = s == null ? void 0 : s[n];
|
|
15166
|
+
const s = { ...(r = this.betPack.getValues().data) == null ? void 0 : r.data }, o = s == null ? void 0 : s[n];
|
|
15151
15167
|
o && (ae.emit("poll", {
|
|
15152
15168
|
action: "voted",
|
|
15153
15169
|
payload: {
|
|
15154
15170
|
questionId: n,
|
|
15155
15171
|
questionType: o.type
|
|
15156
15172
|
}
|
|
15157
|
-
}), o.answers = o.answers.map((
|
|
15158
|
-
...
|
|
15173
|
+
}), o.answers = o.answers.map((c) => c.id === a ? {
|
|
15174
|
+
...c,
|
|
15159
15175
|
youVoted: !0
|
|
15160
|
-
} :
|
|
15176
|
+
} : c), this.betPack.getStore().mutate({ data: s, timestamp: Date.now() }));
|
|
15161
15177
|
});
|
|
15162
15178
|
p(this, "submitAnswer", async (n, a) => {
|
|
15163
15179
|
const s = Dt(n, this.transport), o = s.subscribe(() => {
|
|
@@ -18419,7 +18435,7 @@ const OE = ({
|
|
|
18419
18435
|
f = !0;
|
|
18420
18436
|
};
|
|
18421
18437
|
const _ = bE(e, n, a, {
|
|
18422
|
-
version: "1.14.
|
|
18438
|
+
version: "1.14.5",
|
|
18423
18439
|
onDeepLinkHandled: s,
|
|
18424
18440
|
videoPlayerController: o,
|
|
18425
18441
|
onContentActivate: r,
|