@streamlayer/feature-gamification 1.9.1 → 1.9.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.
@@ -50,6 +50,7 @@ export declare class Gamification extends AbstractFeature<'games', PlainMessage<
50
50
  openedQuestionId: GamificationBackground['openedQuestionId'];
51
51
  advertisement: GamificationBackground['advertisement'];
52
52
  onboardingProcessed: WritableAtom<boolean>;
53
+ friendsTabEnabled: WritableAtom<boolean>;
53
54
  private notifications;
54
55
  private transport;
55
56
  /** gamification background class, handle subscriptions and notifications for closed overlay */
@@ -51,6 +51,7 @@ export class Gamification extends AbstractFeature {
51
51
  openedQuestionId;
52
52
  advertisement;
53
53
  onboardingProcessed;
54
+ friendsTabEnabled;
54
55
  notifications;
55
56
  transport;
56
57
  /** gamification background class, handle subscriptions and notifications for closed overlay */
@@ -103,6 +104,20 @@ export class Gamification extends AbstractFeature {
103
104
  }
104
105
  }));
105
106
  this.background.activeQuestionId.listen(this.showInApp);
107
+ this.friendsTabEnabled = createSingleStore(false);
108
+ this.cancels.add(instance.sdk.options.subscribe((data) => {
109
+ if (data.friendsTab === 'disabled') {
110
+ this.friendsTabEnabled.set(false);
111
+ }
112
+ else if (data.friendsTab === 'enabled') {
113
+ this.friendsTabEnabled.set(true);
114
+ }
115
+ }));
116
+ this.cancels.add(this.settings.subscribe((settings) => {
117
+ if (instance.sdk.options.get().friendsTab === 'activatedGame') {
118
+ this.friendsTabEnabled.set(!!settings.inplayGame?.titleCard?.optIn);
119
+ }
120
+ }));
106
121
  instance.sdk.onMount({ name: 'gamification', clear: true }, () => {
107
122
  return () => {
108
123
  for (const cancel of this.cancels) {
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "peerDependencies": {
5
5
  "@bufbuild/protobuf": "^1.10.0",
6
6
  "@fastify/deepmerge": "^2.0.0",
7
7
  "@streamlayer/sl-eslib": "^5.130.0",
8
8
  "nanostores": "^0.10.3",
9
- "@streamlayer/sdk-web-api": "^1.6.7",
10
- "@streamlayer/sdk-web-core": "^1.6.6",
11
- "@streamlayer/sdk-web-interfaces": "^1.2.7",
12
- "@streamlayer/sdk-web-logger": "^1.0.28",
13
- "@streamlayer/sdk-web-notifications": "^1.2.7",
14
- "@streamlayer/sdk-web-storage": "^1.0.28",
15
- "@streamlayer/sdk-web-types": "^1.8.1"
9
+ "@streamlayer/sdk-web-api": "^1.6.8",
10
+ "@streamlayer/sdk-web-core": "^1.7.0",
11
+ "@streamlayer/sdk-web-interfaces": "^1.2.8",
12
+ "@streamlayer/sdk-web-logger": "^1.0.29",
13
+ "@streamlayer/sdk-web-notifications": "^1.2.8",
14
+ "@streamlayer/sdk-web-storage": "^1.0.29",
15
+ "@streamlayer/sdk-web-types": "^1.8.2"
16
16
  },
17
17
  "devDependencies": {
18
18
  "tslib": "^2.7.0"