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

View File

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