module cache bust

This commit is contained in:
Seth Trowbridge 2025-08-23 10:25:20 -04:00
parent a280e5059f
commit fe1f8cdc53
2 changed files with 5 additions and 2 deletions

5
app.js
View File

@ -28,10 +28,10 @@ async function ReloadAndRedraw(handle)
{
if(handle)
{
const module = await import("./data/room.js");
const module = await import("./data/room.js"+"?rand="+Math.random());
const rooms = module.default();
button.innerText = "change directory";
console.log("rooms loaded:", rooms);
listRoom.innerHTML = "";
Object.entries(rooms).forEach(([roomID, roomData])=>
{
@ -65,6 +65,7 @@ button.addEventListener("click", async()=>
{
const directory = await globalThis.showDirectoryPicker();
await FSHandle.setDirectoryHandle(directory);
handle = await FSHandle.getDirectoryHandle();
await ReloadAndRedraw(handle);
});

View File

@ -13,6 +13,7 @@ async function Interceptor(event)
if(parts[0] == "data" || parts[0] == "room")
{
console.log("intercept", pathname)
const extension = pathname.substring(pathname.lastIndexOf('.') + 1);
// Intercept only JavaScript files
if ( extension == "js" || extension == "json" )
@ -43,6 +44,7 @@ async function Interceptor(event)
}
catch(e)
{
console.log("couldnt find it", pathname)
return fetch(event.request);
}