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

fix: pass the results of userChoice to the developers #135

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

QC-L
Copy link
Contributor

@QC-L QC-L commented May 20, 2024

There are times when we need to handle different logic based on the result of userChoice.

$pwa?.install().then((userChoice) => {
	if (userChoice.outcome === 'accepted') {
		console.log('accepted install');
	}
})

Copy link
Member

@userquin userquin left a comment

Choose a reason for hiding this comment

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

@QC-L thx ❤️

The type can be undefined in the promise, anyone can call the install method at any time

@userquin userquin merged commit 3df8e8c into vite-pwa:main Jun 21, 2024
@userquin
Copy link
Member

userquin commented Jun 21, 2024

Note: if the user installs the app, some platforms will close the app in the browser and will open the installed PWA (for example Chrome and Edge in Windows Desktop).

Updating docs...

@QC-L QC-L deleted the patch-1 branch June 28, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants