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

PWA: Only allow the install bar when the WordCamp is approaching/running #315

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Jan 10, 2020

This prevents Chrome from displaying the mini-infobar ("Add [WordCamp] to your home screen") when the event is more than 2 weeks away. This is only added to sites that have the PWA plugin active.

See #129 for discussion around removing vs limiting the banner.

How to test the changes in this Pull Request:

As far as I can tell, the banner only shows up on Android + Chrome, so to functionally test, you need an Android & to proxy your sandbox so you can access it from mobile. I used Charles for this, but you could also just verify that the code to prevent the banner appears when expected (2 weeks before until 1 week after the start date of the camp, for any site that has the PWA plugin active).

This prevents Chrome from displaying the mini-infobar ("Add [WordCamp] to your home screen") when the event is more than 2 weeks away.
@ryelle ryelle added [Status] Needs Review [Component] PWA Service workers, manifest labels Jan 10, 2020
@ryelle ryelle added this to the PWA Initial Version milestone Jan 10, 2020
@ryelle ryelle self-assigned this Jan 10, 2020
Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

Verified locally that the code appears when camp start date is outside of the window 👍

@ryelle ryelle merged commit 3af3274 into production Jan 14, 2020
@ryelle ryelle deleted the update/pwa-conditional-install-prompt branch January 14, 2020 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] PWA Service workers, manifest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants