diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2023-02-18 14:11:45 +0000 |
|---|---|---|
| committer | tamaina <tamaina@hotmail.co.jp> | 2023-02-18 14:11:45 +0000 |
| commit | cd5615d3549e7b46d670b863e77e66a32de80da9 (patch) | |
| tree | 0ad3bfb113f887680dfc68507114c25704804574 /packages/sw/src/scripts | |
| parent | fix/enhance(sw): プッシュ通知 (バックグラウンドで開いてい... (diff) | |
| download | sharkey-cd5615d3549e7b46d670b863e77e66a32de80da9.tar.gz sharkey-cd5615d3549e7b46d670b863e77e66a32de80da9.tar.bz2 sharkey-cd5615d3549e7b46d670b863e77e66a32de80da9.zip | |
fix lint
Diffstat (limited to 'packages/sw/src/scripts')
| -rw-r--r-- | packages/sw/src/scripts/create-notification.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 14f96816a3..da92b37d19 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -14,7 +14,7 @@ const closeNotificationsByTags = async (tags: string[]) => { for (const n of (await Promise.all(tags.map(tag => globalThis.registration.getNotifications({ tag })))).flat()) { n.close(); } -} +}; const iconUrl = (name: badgeNames) => `/static-assets/tabler-badges/${name}.png`; /* How to add a new badge: @@ -183,11 +183,10 @@ async function composeNotification(data: pushNotificationDataMap[keyof pushNotif } case 'pollEnded': - const tag = `poll:${data.body.note.id}`; return [t('_notification.pollEnded'), { body: data.body.note.text || '', badge: iconUrl('chart-arrows'), - tag, + tag: `poll:${data.body.note.id}`, data, }]; @@ -228,12 +227,11 @@ async function composeNotification(data: pushNotificationDataMap[keyof pushNotif return null; } case 'unreadAntennaNote': - const tag = `antenna:${data.body.antenna.id}`; 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('antenna'), - tag, + tag: `antenna:${data.body.antenna.id}`, data, renotify: true, }]; |