@streamlayer/feature-gamification 0.41.1 → 0.41.2

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.
@@ -81,7 +81,7 @@ export class Gamification extends AbstractFeature {
81
81
  this.connect();
82
82
  // refresh leaderboard on user summary update after earning points
83
83
  this.cancels.add(this.userSummary.$store.listen((userSummary, prevValue) => {
84
- if (prevValue?.summary && userSummary?.summary && !userSummary.fromLeaderboard) {
84
+ if (prevValue?.summary && userSummary?.summary) {
85
85
  this.leaderboardList.invalidate(); // verified, it's necessary
86
86
  }
87
87
  }));
@@ -3,8 +3,6 @@ import { ReadableAtom } from 'nanostores';
3
3
  import { LeaderboardSummaryItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
4
4
  import { Gamification } from '.';
5
5
  export declare const summary: ($eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, $friends: Gamification['friends'], transport: Transport) => {
6
- $store: import("nanostores").MapStore<(LeaderboardSummaryItem & {
7
- fromLeaderboard?: boolean | undefined;
8
- }) | undefined>;
6
+ $store: import("nanostores").MapStore<LeaderboardSummaryItem | undefined>;
9
7
  invalidate: () => void;
10
8
  };
@@ -22,10 +22,6 @@ export const summary = ($eventId, $userId, $friends, transport) => {
22
22
  usersIds: [...usersIds, userId],
23
23
  };
24
24
  const res = await fetch(request);
25
- const prevData = $store.get()?.summary?.friendsRank;
26
- if (res.data?.attributes?.summary?.friendsRank && prevData !== undefined) {
27
- res.data.attributes.summary.friendsRank = prevData;
28
- }
29
25
  $store.set(res.data?.attributes);
30
26
  };
31
27
  const invalidate = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "0.41.1",
3
+ "version": "0.41.2",
4
4
  "peerDependencies": {
5
5
  "@bufbuild/protobuf": "^1.8.0",
6
6
  "@fastify/deepmerge": "^1.3.0",