Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 16-progressive-web-apps.mdx #70400

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

preitinger
Copy link

The code in the original doc is not valid typescript because window.PushSubscription is mixed up with webpush.PushSubscription from 'web-push'. I checked in possible fixes (and old code commented out- should be removed when accepted in main branch).

The code in the original doc is not valid typescript because window.PushSubscription is mixed up with webpush.PushSubscription from 'web-push'. I checked in possible fixes (and old code commented out- should be removed when accepted in main branch).
@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Sep 24, 2024
@ijjk
Copy link
Member

ijjk commented Sep 24, 2024

Allow CI Workflow Run

  • approve CI run for commit: 687438d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

JSON.stringify({
title: 'Test Notification',
body: message,
icon: '/icon.png',
})
)
// old, but a type bug because PushSubscription from client is mixed up with webpush.PushSubscription which is required by webpush.sendNotification():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is invalid we should remove it and not leave it around

@@ -251,7 +251,10 @@ function PushNotificationManager() {
),
});
setSubscription(sub);
await subscribeUser(sub);
// TODO The following old line is a bug because subscribeUser is a server function and may only receive plain objects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants