This commit is contained in:
Rizky 2024-07-20 14:06:16 +07:00
parent 5e9dd4e4c9
commit d51bdad679
1 changed files with 14 additions and 4 deletions

View File

@ -103,10 +103,20 @@ export const serveStatic = {
if (g.mode === "dev") {
await this.walk();
} else {
return new Response("", {
status: 404,
headers: { "content-type": "text/javascript" },
});
return new Response(
`
navigator.serviceWorker.getRegistration().then(function(reg) {
if (reg) {
reg.unregister().then(function() { window.location.reload(true); });
} else {
window.location.reload(true);
}
});
`,
{
headers: { "content-type": "text/javascript" },
}
);
}
}