From 9962e2ce43e0fe613da1afbe81fcac2d411db3ff Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Tue, 15 Oct 2024 16:34:31 +0200 Subject: [PATCH] Make sure caches for the 2 demos do not override each other --- src/lib/WebVM.svelte | 3 ++- src/routes/+page.svelte | 2 +- src/routes/alpine/+page.svelte | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/WebVM.svelte b/src/lib/WebVM.svelte index 76b02b5..356eb7e 100644 --- a/src/lib/WebVM.svelte +++ b/src/lib/WebVM.svelte @@ -15,6 +15,7 @@ export let configObj = null; export let processCallback = null; + export let cacheId = null; var term = new Terminal({cursorBlink:true, convertEol:true, fontFamily:"monospace", fontWeight: 400, fontWeightBold: 700}); var cx = null; @@ -124,7 +125,7 @@ default: throw new Error("Unrecognized device type"); } - var overlayDevice = await CheerpX.OverlayDevice.create(blockDevice, await CheerpX.IDBDevice.create("block1")); + var overlayDevice = await CheerpX.OverlayDevice.create(blockDevice, await CheerpX.IDBDevice.create(cacheId)); var webDevice = await CheerpX.WebDevice.create(""); var dataDevice = await CheerpX.DataDevice.create(); var mountPoints = [ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8f4c942..436feea 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -11,4 +11,4 @@ function handleProcessCreated(processCount) } - + diff --git a/src/routes/alpine/+page.svelte b/src/routes/alpine/+page.svelte index b9099ce..4a3f5b6 100644 --- a/src/routes/alpine/+page.svelte +++ b/src/routes/alpine/+page.svelte @@ -11,4 +11,4 @@ function handleProcessCreated(processCount) } - +