module cache bust
This commit is contained in:
parent
a280e5059f
commit
fe1f8cdc53
5
app.js
5
app.js
@ -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);
|
||||
});
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user