diff options
| author | misskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com> | 2026-03-05 10:56:50 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 10:56:50 +0000 |
| commit | fe3dd8edb5f30104cd0a7ed755eb254feda2922d (patch) | |
| tree | af6cf5fa4ca75302ac2de5db742cead00bc13d21 /packages/sw/src/scripts/create-notification.ts | |
| parent | Merge pull request #16998 from misskey-dev/develop (diff) | |
| parent | Release: 2026.3.0 (diff) | |
| download | misskey-fe3dd8edb5f30104cd0a7ed755eb254feda2922d.tar.gz misskey-fe3dd8edb5f30104cd0a7ed755eb254feda2922d.tar.bz2 misskey-fe3dd8edb5f30104cd0a7ed755eb254feda2922d.zip | |
Merge pull request #17217 from misskey-dev/develop
Release: 2026.3.0
Diffstat (limited to 'packages/sw/src/scripts/create-notification.ts')
| -rw-r--r-- | packages/sw/src/scripts/create-notification.ts | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 783c78f7dc..6dfea12aa8 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -292,30 +292,28 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif } export async function createEmptyNotification(): Promise<void> { - return new Promise<void>(async res => { - const i18n = await (swLang.i18n ?? swLang.fetchLocale()); - - await globalThis.registration.showNotification( - (new URL(origin)).host, - { - body: `Misskey v${_VERSION_}`, - silent: true, - badge: iconUrl('null'), - tag: 'read_notification', - actions: [ - { - action: 'markAllAsRead', - title: i18n.ts.markAllAsRead, - }, - { - action: 'settings', - title: i18n.ts.notificationSettings, - }, - ], - data: {}, - }, - ); - + const i18n = await (swLang.i18n ?? swLang.fetchLocale()); + await globalThis.registration.showNotification( + (new URL(origin)).host, + { + body: `Misskey v${_VERSION_}`, + silent: true, + badge: iconUrl('null'), + tag: 'read_notification', + actions: [ + { + action: 'markAllAsRead', + title: i18n.ts.markAllAsRead, + }, + { + action: 'settings', + title: i18n.ts.notificationSettings, + }, + ], + data: {}, + }, + ); + return new Promise<void>(res => { setTimeout(async () => { try { await closeNotificationsByTags(['user_visible_auto_notification']); |