Skip to content

Commit

Permalink
Merge pull request haishanh#753 from everyx/master
Browse files Browse the repository at this point in the history
fix: infinite refreshing when host at subpath
  • Loading branch information
haishanh authored Mar 25, 2023
2 parents 85f1ed7 + 16c8651 commit e533e8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/swRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function register(config?: Config) {
}

window.addEventListener('load', () => {
const swUrl = `./sw.js`;
const swUrl = new URL('sw.js', publicUrl.href).href;

if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
Expand Down

1 comment on commit e533e8e

@vercel
Copy link

@vercel vercel bot commented on e533e8e Apr 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

yacd – ./

yacd-nine.vercel.app
yacd-git-master-gxkl.vercel.app
yacd-gxkl.vercel.app

Please sign in to comment.