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)
|
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);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user