Closed vicb closed 5 months ago
[!WARNING]
Review failed
The pull request is closed.
The recent changes enhance the flyXC
web app by adjusting event handling during the installation prompt and moving service worker registration to the global scope for better reliability. Additionally, the service worker logic has been updated to include a new route, ensuring comprehensive coverage. These modifications refine user interactions and optimize background processes without altering public APIs.
File | Change Summary |
---|---|
apps/fxc-front/index.html |
Added stopPropagation() and stopImmediatePropagation() to beforeinstallprompt event handling. |
apps/fxc-front/src/flyxc.ts |
Moved registerSW call to global scope; added updateServiceWorker function. |
...front/src/sw.ts |
Updated isIndexRoute function to include /3d path. |
sequenceDiagram
participant User
participant Browser
participant ServiceWorker
participant App
User->>Browser: Navigates to site
Browser->>App: Loads index.html
App->>Browser: Handles beforeinstallprompt
Browser-->>App: Event triggered
Note over App: Stops propagation<br/> Predefaults action
User->>Browser: Route includes /3d
Browser->>ServiceWorker: Checks isIndexRoute
ServiceWorker-->>Browser: Response includes /3d
Browser->>App: Registers service worker (global scope)
App-->>ServiceWorker: Calls registerSW globally
ServiceWorker-->>App: SW registered and updated
Amidst the code, where changes bloom,
Our FlyXC thrives, dispelling gloom.
In global scope, the workers cheer,
While prompts are tamed, so smooth and clear.
With routes anew, we soar and glide,
In digital skies, we take our ride.
Oh, the joy in updates' stride! 🚀✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This pull request addresses issues with the service worker registration and improves the handling of the beforeinstallprompt event. The changes include adding additional event propagation control in the index.html file, refactoring the service worker registration logic in flyxc.ts, and updating the list of index routes in sw.ts.
Files | Changes |
---|---|
apps/fxc-front/index.html apps/fxc-front/src/flyxc.ts |
Refactored service worker registration and improved event handling for the beforeinstallprompt event. |
Latest commit: |
c63f0dd
|
Status: | ✅ Deploy successful! |
Preview URL: | https://5104da19.flyxc.pages.dev |
Branch Preview URL: | https://sw-fix.flyxc.pages.dev |
Summary by Sourcery
This pull request addresses issues with the service worker by fixing its registration and update logic. Additionally, it enhances the handling of the 'beforeinstallprompt' event to prevent unwanted event propagation.
Summary by CodeRabbit
beforeinstallprompt
event for better user experience./3d
route.