@live-change/notification-service 0.8.30 → 0.8.32
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/notification.js +4 -6
- package/package.json +3 -3
package/notification.js
CHANGED
|
@@ -224,8 +224,7 @@ definition.trigger({
|
|
|
224
224
|
notification,
|
|
225
225
|
data: { ...data, sessionOrUserType, sessionOrUser, time, readState: 'new' }
|
|
226
226
|
})
|
|
227
|
-
await app.trigger({
|
|
228
|
-
type: 'notificationCreated',
|
|
227
|
+
await app.trigger({ type: 'notificationCreated' }, {
|
|
229
228
|
notification,
|
|
230
229
|
...data
|
|
231
230
|
})
|
|
@@ -238,8 +237,8 @@ async function notificationAccess({ notification }, { client, visibilityTest })
|
|
|
238
237
|
const notificationRow = await Notification.get(notification)
|
|
239
238
|
if(!notificationRow) throw 'notFound'
|
|
240
239
|
return client.user
|
|
241
|
-
? notificationRow.sessionOrUserType
|
|
242
|
-
: notificationRow.sessionOrUserType
|
|
240
|
+
? notificationRow.sessionOrUserType === 'user_User' && notificationRow.sessionOrUser === client.user
|
|
241
|
+
: notificationRow.sessionOrUserType === 'session_Session' && notificationRow.sessionOrUser === client.session
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
definition.action({
|
|
@@ -382,8 +381,7 @@ definition.action({
|
|
|
382
381
|
if(!notificationType) notificationType = 'example_TestNotification'
|
|
383
382
|
const fields = {}
|
|
384
383
|
for(const key in config.fields) fields[key] = data[key]
|
|
385
|
-
service.trigger({
|
|
386
|
-
type: 'notify',
|
|
384
|
+
service.trigger({ type: 'notify' }, {
|
|
387
385
|
sessionOrUserType: client.user ? 'user_User' : 'session_Session',
|
|
388
386
|
sessionOrUser: client.user || client.session,
|
|
389
387
|
notificationType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/notification-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "^0.8.
|
|
24
|
+
"@live-change/framework": "^0.8.32"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "9ea7767670a99404794087726223064c45d798d3",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|