From 36170a11f5b889cae3feda6bd4c666aafee98fef Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 18 Feb 2023 05:16:34 +0000 Subject: refactor(sw): self => globalThis --- packages/sw/src/scripts/create-notification.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/sw/src/scripts/create-notification.ts') diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index c121b30bef..e45c3f504c 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -23,7 +23,7 @@ export async function createNotification; const { t } = i18n; - await self.registration.showNotification( + await globalThis.registration.showNotification( t('_notification.emptyPushNotificationMessage'), { silent: true, @@ -253,8 +253,8 @@ export async function createEmptyNotification() { setTimeout(async () => { for (const n of [ - ...(await self.registration.getNotifications({ tag: 'user_visible_auto_notification' })), - ...(await self.registration.getNotifications({ tag: 'read_notification' })), + ...(await globalThis.registration.getNotifications({ tag: 'user_visible_auto_notification' })), + ...(await globalThis.registration.getNotifications({ tag: 'read_notification' })), ] ) { n.close(); -- cgit v1.2.3-freya