diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2022-12-18 19:50:02 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-18 19:50:02 +0900 |
| commit | 867e31c9ffefb57d01add5ad8568151fce39614c (patch) | |
| tree | 133bec354505986b0db3bf95353b24e2d8277792 /packages/sw/src/scripts | |
| parent | chore(client): :art: about button (#9339) (diff) | |
| download | sharkey-867e31c9ffefb57d01add5ad8568151fce39614c.tar.gz sharkey-867e31c9ffefb57d01add5ad8568151fce39614c.tar.bz2 sharkey-867e31c9ffefb57d01add5ad8568151fce39614c.zip | |
enhance: Push notification of Antenna note (#9338)
* wip
* wip
* wip
* fix
* fix
* :art:
Diffstat (limited to 'packages/sw/src/scripts')
| -rw-r--r-- | packages/sw/src/scripts/create-notification.ts | 9 | ||||
| -rw-r--r-- | packages/sw/src/scripts/operations.ts | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index c27e8c709c..fd5b0fa312 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -252,6 +252,15 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data data, renotify: true, }]; + case 'unreadAntennaNote': + return [t('_notification.unreadAntennaNote', { name: data.body.antenna.name }), { + body: `${getUserName(data.body.note.user)}: ${data.body.note.text || ''}`, + icon: data.body.note.user.avatarUrl, + badge: iconUrl('satellite'), + tag: `antenna:${data.body.antenna.id}`, + data, + renotify: true, + }]; default: return null; } diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index fd27418073..719e3ea9fa 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -27,6 +27,11 @@ export function openNote(noteId: string, loginId: string) { return openClient('push', `/notes/${noteId}`, loginId, { noteId }); } +// noteIdからノートを開く +export function openAntenna(antennaId: string, loginId: string) { + return openClient('push', `/timeline/antenna/${antennaId}`, loginId, { antennaId }); +} + export async function openChat(body: any, loginId: string) { if (body.groupId === null) { return openClient('push', `/my/messaging/${getAcct(body.user)}`, loginId, { body }); |