@streamlayer/feature-gamification 1.7.0 → 1.8.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.
@@ -26,6 +26,18 @@ export const advertisement = ($slStreamId, $feedSubscription, instance) => {
26
26
  const $activeAdvertisement = $activePromotionId($slStreamId, transport);
27
27
  const open = () => {
28
28
  $store.setKey('hasNotification', false);
29
+ const payload = $store.get();
30
+ const id = payload.data?.question.id;
31
+ const type = payload.data?.promotion?.type;
32
+ if (id) {
33
+ eventBus.emit('advertisement', {
34
+ action: 'notification-opened',
35
+ payload: {
36
+ id,
37
+ type,
38
+ },
39
+ });
40
+ }
29
41
  };
30
42
  const markAsViewed = () => {
31
43
  const payload = $store.get();
@@ -125,7 +125,6 @@ export class Gamification extends AbstractFeature {
125
125
  };
126
126
  connect = () => {
127
127
  this.onboardingProcessed.subscribe((status) => {
128
- console.log('onboardingProcessed status', status);
129
128
  if (status) {
130
129
  this.advertisement.connect();
131
130
  }
package/lib/onboarding.js CHANGED
@@ -106,7 +106,6 @@ export const onboarding = (service, background, transport, notifications) => {
106
106
  const storage = new GamificationStorage();
107
107
  const $store = createSingleStore(OnboardingStatus.Unset);
108
108
  $store.subscribe((onboardingStatus) => {
109
- console.log('onboardingStatus', onboardingStatus);
110
109
  if (onboardingStatus === OnboardingStatus.Unset) {
111
110
  return;
112
111
  }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
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-core": "^1.5.0",
10
- "@streamlayer/sdk-web-interfaces": "^1.2.0",
11
- "@streamlayer/sdk-web-logger": "^1.0.21",
12
- "@streamlayer/sdk-web-api": "^1.6.0",
13
- "@streamlayer/sdk-web-notifications": "^1.2.0",
14
- "@streamlayer/sdk-web-storage": "^1.0.21",
15
- "@streamlayer/sdk-web-types": "^1.7.0"
9
+ "@streamlayer/sdk-web-api": "^1.6.2",
10
+ "@streamlayer/sdk-web-core": "^1.6.1",
11
+ "@streamlayer/sdk-web-interfaces": "^1.2.2",
12
+ "@streamlayer/sdk-web-logger": "^1.0.23",
13
+ "@streamlayer/sdk-web-notifications": "^1.2.2",
14
+ "@streamlayer/sdk-web-storage": "^1.0.23",
15
+ "@streamlayer/sdk-web-types": "^1.7.2"
16
16
  },
17
17
  "devDependencies": {
18
18
  "tslib": "^2.7.0"