@streamlayer/feature-gamification 0.27.2 → 0.29.0

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/detail.js CHANGED
@@ -25,6 +25,9 @@ export const detail = (transport, $openedQuestionId, $feedList) => {
25
25
  if (feedList.data) {
26
26
  return feedList.data.find((item) => item.id === openedQuestion);
27
27
  }
28
+ else {
29
+ console.error('Feed list is not loaded yet. Issue with the opened question.');
30
+ }
28
31
  }
29
32
  return undefined;
30
33
  });
@@ -128,14 +128,8 @@ export class Gamification extends AbstractFeature {
128
128
  title: question.data.question.notification.title,
129
129
  body: question.data.question.notification.body,
130
130
  image: question.data.question.notification.image,
131
- account: {
132
- // ToDo: add later
133
- image: '',
134
- name: optionsValue?.tweetMeta?.account || '',
135
- // ToDo: add later
136
- userName: '',
137
- verified: !!optionsValue?.tweetMeta?.accountVerified,
138
- },
131
+ account: optionsValue?.tweetMeta?.account || '',
132
+ accountVerified: !!optionsValue?.tweetMeta?.accountVerified,
139
133
  };
140
134
  this.notifications.add({
141
135
  type: NotificationType.QUESTION,
@@ -192,6 +186,7 @@ export class Gamification extends AbstractFeature {
192
186
  correctAnswerTitle: correctAnswer?.text,
193
187
  correct: correctAnswer?.youVoted,
194
188
  predictionResult: status === QuestionStatus.RESOLVED,
189
+ questionTitle: question?.subject,
195
190
  },
196
191
  },
197
192
  });
package/lib/onboarding.js CHANGED
@@ -33,6 +33,7 @@ export const onboarding = (service, background, transport, notifications) => {
33
33
  close: () => {
34
34
  notifications.markAsViewed(notificationId);
35
35
  },
36
+ delay: 1000,
36
37
  autoHideDuration: 1000000,
37
38
  data: {
38
39
  questionType: QuestionType.UNSET,
@@ -113,6 +114,8 @@ export const onboarding = (service, background, transport, notifications) => {
113
114
  userId: background.userId.get() || '',
114
115
  eventId,
115
116
  }, OnboardingStatus.Completed);
117
+ const notificationId = background.getCurrentSessionId({ prefix: 'onboarding' });
118
+ notifications.close(notificationId);
116
119
  }
117
120
  };
118
121
  return { $store, submitInplay };
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "0.27.2",
3
+ "version": "0.29.0",
4
4
  "peerDependencies": {
5
5
  "@bufbuild/protobuf": "^1.4.2",
6
6
  "@streamlayer/sl-eslib": "^5.53.6",
7
7
  "@fastify/deepmerge": "*",
8
8
  "nanostores": "^0.9.5",
9
9
  "@streamlayer/sdk-web-api": "^0.1.0",
10
- "@streamlayer/sdk-web-core": "^0.0.6",
10
+ "@streamlayer/sdk-web-core": "^0.0.7",
11
11
  "@streamlayer/sdk-web-interfaces": "^0.0.1",
12
12
  "@streamlayer/sdk-web-logger": "^0.0.1",
13
- "@streamlayer/sdk-web-notifications": "^0.13.4",
14
- "@streamlayer/sdk-web-types": "^0.0.1",
13
+ "@streamlayer/sdk-web-notifications": "^0.1.0",
14
+ "@streamlayer/sdk-web-types": "^0.1.0",
15
15
  "@streamlayer/sdk-web-storage": "^0.0.4"
16
16
  },
17
17
  "devDependencies": {