Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ const App = Application.extend({
loadInitializers(App, config.modulePrefix);

export default App;

if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/service-worker.js');
Copy link

Choose a reason for hiding this comment

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

question: Clarify whether service worker registration should occur in all environments or be gated by environment checks.

Unconditional registration will also run in local and test environments, potentially causing confusing caching behavior. Consider guarding this with an environment check (e.g., only in production or behind a config flag) to avoid unintended caching during development.

});
}