-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat: pwa install on desktop #3889
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
…install-pwa-desktop
…ydotdev/apps into feat-install-pwa-desktop
…install-pwa-desktop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing! Really appreciate the generic function to determine which browser is being used 🚀
Just kindly test it out since it has been a while since this was raised, to ensure it would run as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor points so approving for now, but do check.
import type { BrowserName } from '../../../lib/func'; | ||
import { getCurrentBrowserName, isPWA } from '../../../lib/func'; | ||
|
||
interface IBeforeInstallPromptEvent extends Event { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never really use the I prefix naming (non trivial but would avoid it moving forward)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BeforeInstallPromptEvent
is the original type name for this so I'm using a different name avoiding future collision. But I'm renaming in order to remove the prefix ✔️
let installEvent: IBeforeInstallPromptEvent | null = null; | ||
globalThis?.addEventListener?.( | ||
'beforeinstallprompt', | ||
(e: IBeforeInstallPromptEvent) => { | ||
e.preventDefault(); | ||
installEvent = e; | ||
}, | ||
{ once: true }, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure you tested it on the browsers that need it, if it works it's fine with me
isLaptop && | ||
!isCurrentPWA && | ||
canUserInstallDesktop && | ||
activeScreen !== OnboardingStep.InstallDesktop && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to see but doesn't this now prompt it as the first screen?
Also steps beyond this might re-show it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested and this works as intended.
At this point of the function there is no chance to get evaluated before last step ✔️
Changes
onClickNext
for handling skipping specific step;Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Name :
onboarding_desktop_pwa
Available options:
boolean
(true/false)Enrollment for users:
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Preview domain
https://feat-install-pwa-desktop.preview.app.daily.dev