Skip to content

Commit

Permalink
Revert "register SW in deploy preview"
Browse files Browse the repository at this point in the history
This reverts commit dc8636b.
  • Loading branch information
cherniavskii committed May 18, 2023
1 parent dc8636b commit 83086a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ function forcePageReload(registration) {
}

async function registerServiceWorker() {
if ('serviceWorker' in navigator && process.env.NODE_ENV === 'production') {
if (
'serviceWorker' in navigator &&
process.env.NODE_ENV === 'production' &&
window.location.host.indexOf('mui.com') !== -1
) {
// register() automatically attempts to refresh the sw.js.
const registration = await navigator.serviceWorker.register('/x/sw.js');
// Force the page reload for users.
Expand Down

0 comments on commit 83086a7

Please sign in to comment.