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

service worker changes #42

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 3 additions & 7 deletions packages/core/src/pages/StudentLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,9 @@ export default function StudentLogin({ swPath }) {
<H3 style={{ fontSize: "16px" }}>
Accelerated Learning via Technology (ALT)
</H3>
{/* <H3 style={{ fontSize: "16px", color : "red" }}>
Reminder :
Dear Students,
Thank you for participating in the ALT Version 1 pilot.
We officially closed the pilot on 19th November, 2023.

</H3> */}
<H3 style={{ fontSize: "16px", color: "red" }}>
Reminder : Testing service worker changes.
</H3>
</Box>
</Center>
<Center>
Expand Down
6 changes: 5 additions & 1 deletion packages/studentprogram/src/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ registerRoute(
return false;
} // If this looks like a URL for a resource, because it contains // a file extension, skip.

if (url.pathname.match(fileExtensionRegexp)) {
// If this looks like a URL for a resource and doesn't end with .html, skip.
if (
url.pathname.match(fileExtensionRegexp) &&
!url.pathname.endsWith(".html")
) {
return false;
} // Return true to signal that we want to use the handler.

Expand Down
6 changes: 4 additions & 2 deletions packages/studentprogram/src/serviceWorkerRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ function checkValidServiceWorker(swUrl, config) {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
} else if (
// Exclude HTML files from checking
!swUrl.endsWith(".html")
) {
registerValidSW(swUrl, config);
}
})
Expand Down