Skip to content

Commit

Permalink
scope on prod to /search
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Oct 8, 2024
1 parent 372e461 commit e8d3988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const Main = () => {
const base_url = import.meta.env.PROD
? "/search/serviceWorker.js"
: "/serviceWorker.js";
const scope_url = import.meta.env.PROD ? "/search/" : "./search";
const scope_url = import.meta.env.PROD ? "/search/" : "/search";

const registerServiceWorker = async () => {
if ("serviceWorker" in navigator) {
try {
const registration = await navigator.serviceWorker.register(base_url, {
scope: scope_url,
scope: "/search",
});
console.log("scope", registration.scope);
console.log("controlled", navigator.serviceWorker.controller);
Expand Down

0 comments on commit e8d3988

Please sign in to comment.