@streamlayer/feature-gamification 0.25.0 → 0.26.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.
@@ -119,6 +119,33 @@ export class Gamification extends AbstractFeature {
119
119
  },
120
120
  });
121
121
  }
122
+ else if (question.data.question.type === QuestionType.TWEET) {
123
+ const optionsValue = question.data.question.options?.options.value;
124
+ const tweetView = {
125
+ title: question.data.question.notification.title,
126
+ body: question.data.question.notification.body,
127
+ image: question.data.question.notification.image,
128
+ account: {
129
+ // ToDo: add later
130
+ image: '',
131
+ name: optionsValue?.tweetMeta?.account || '',
132
+ // ToDo: add later
133
+ userName: '',
134
+ verified: !!optionsValue?.tweetMeta?.accountVerified,
135
+ },
136
+ };
137
+ this.notifications.add({
138
+ type: NotificationType.QUESTION,
139
+ action: () => question.data?.question && this.openQuestion(question.data.question.id),
140
+ close: () => question.data?.question && this.closeQuestion(question.data.question.id),
141
+ autoHideDuration: 1000 * +(question.data.question?.appearance?.autoHideInterval || '5'),
142
+ id: this.background.getCurrentSessionId({ prefix: 'notification', entity: question.data.question.id }),
143
+ data: {
144
+ questionType: question.data.question.type,
145
+ tweet: tweetView,
146
+ },
147
+ });
148
+ }
122
149
  }
123
150
  }
124
151
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "peerDependencies": {
5
5
  "@bufbuild/protobuf": "^1.4.2",
6
6
  "@streamlayer/sl-eslib": "^5.53.6",
@@ -10,7 +10,7 @@
10
10
  "@streamlayer/sdk-web-core": "^0.17.8",
11
11
  "@streamlayer/sdk-web-interfaces": "^0.18.15",
12
12
  "@streamlayer/sdk-web-logger": "^0.0.4",
13
- "@streamlayer/sdk-web-notifications": "^0.12.1",
13
+ "@streamlayer/sdk-web-notifications": "^0.13.0",
14
14
  "@streamlayer/sdk-web-storage": "^0.0.4",
15
15
  "@streamlayer/sdk-web-types": "^0.20.1"
16
16
  },