@live-change/notification-service 0.8.31 → 0.8.33

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.
Files changed (2) hide show
  1. package/notification.js +4 -6
  2. 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 == 'user_User' && notificationRow.sessionOrUser == client.user
242
- : notificationRow.sessionOrUserType == 'session_Session' && notificationRow.sessionOrUser == client.session
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.31",
3
+ "version": "0.8.33",
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.31"
24
+ "@live-change/framework": "^0.8.33"
25
25
  },
26
- "gitHead": "9ab10c6f2854dd5472cc6becb128951db16218e3",
26
+ "gitHead": "98ff6f9c09e5fc1f408010df6cc8038eff571276",
27
27
  "type": "module"
28
28
  }