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

feat: error page when service worker not available #283

Merged

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Jun 5, 2024

Title

feat: error page when service worker not available

Description

Basic error page implementation for users who don't have serviceWorker available.

Fixes #272

Notes & open questions

image

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@SgtPooki SgtPooki linked an issue Jun 5, 2024 that may be closed by this pull request
@SgtPooki SgtPooki self-assigned this Jun 5, 2024
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

src/index.tsx Outdated
Comment on lines 17 to 23
let ErrorPage: null | React.LazyExoticComponent<() => React.JSX.Element> = null
if (navigator.serviceWorker == null) {
ErrorPage = LazyServiceWorkerErrorPage
}

const routes: Route[] = [
{ default: true, component: LazyHelperUi },
{ default: true, component: ErrorPage ?? LazyHelperUi },
Copy link
Member Author

Choose a reason for hiding this comment

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

gives us the ability to easily set different error pages for other conditions, without fronting the loading of all the errors for all users.

src/pages/errors/no-service-worker.tsx Outdated Show resolved Hide resolved
@SgtPooki
Copy link
Member Author

SgtPooki commented Jun 5, 2024

Updated UI to include the header & about components, and red error display with a873b7c (#283)

image

@SgtPooki SgtPooki marked this pull request as ready for review June 5, 2024 18:43
@SgtPooki SgtPooki requested review from lidel and 2color June 5, 2024 18:43
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

reviewed latest changes

@SgtPooki
Copy link
Member Author

ping @lidel @2color

Copy link
Member

@2color 2color left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

@SgtPooki thank you, lgtm.

Small suggestions/asks inline (feel free to merge once addressed)

src/index.tsx Outdated Show resolved Hide resolved
src/index.tsx Outdated Show resolved Hide resolved
src/pages/errors/no-service-worker.tsx Outdated Show resolved Hide resolved
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

@lidel what do you think about a link to ff discussion

src/pages/errors/no-service-worker.tsx Outdated Show resolved Hide resolved
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

lgtm! let's land this

image

@SgtPooki
Copy link
Member Author

yay, CI finally passed. merging.

@SgtPooki SgtPooki merged commit 774e388 into main Jun 28, 2024
16 checks passed
@SgtPooki SgtPooki deleted the 272-user-friendly-error-when-navigatorserviceworker-is-undefined branch June 28, 2024 18:33
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.

User-friendly error when navigator.serviceWorker is undefined
3 participants