(decoder: decoding.Decoder)
| 423 | } |
| 424 | } |
| 425 | private async _handleUserNotification(decoder: decoding.Decoder) { |
| 426 | const notifObj: DeepNotesNotification = unpack( |
| 427 | decoding.readVarUint8Array(decoder), |
| 428 | ); |
| 429 | |
| 430 | pagesStore().notifications.items.unshift(notifObj); |
| 431 | |
| 432 | const symmetricKey = wrapSymmetricKey( |
| 433 | internals.keyPair.decrypt(notifObj.encryptedSymmetricKey), |
| 434 | ); |
| 435 | |
| 436 | const notifContent = unpack( |
| 437 | symmetricKey.decrypt(notifObj.encryptedContent, { |
| 438 | padding: true, |
| 439 | associatedData: { context: 'UserNotificationContent' }, |
| 440 | }), |
| 441 | ); |
| 442 | |
| 443 | this._logger |
| 444 | .sub('_handleUserNotification') |
| 445 | .info('notifObj: %o', notifObj); |
| 446 | this._logger |
| 447 | .sub('_handleUserNotification') |
| 448 | .info('content: %o', notifContent); |
| 449 | |
| 450 | if (notifContent.agentId != null) { |
| 451 | pagesStore().groups[notifContent.groupId]?.userIds.add( |
| 452 | notifContent.agentId, |
| 453 | ); |
| 454 | } |
| 455 | |
| 456 | if (notifContent.patientId != null) { |
| 457 | pagesStore().groups[notifContent.groupId]?.userIds.add( |
| 458 | notifContent.patientId, |
| 459 | ); |
| 460 | } |
| 461 | |
| 462 | const notifInfo = await getNotificationInfo(notifObj, notifContent); |
| 463 | |
| 464 | $quasar().notify({ |
| 465 | ...notifInfo, |
| 466 | |
| 467 | actions: notifInfo.actions, |
| 468 | }); |
| 469 | } |
| 470 | |
| 471 | isSynced< |
| 472 | DataPrefix_ extends DataPrefix, |
no test coverage detected