diff --git a/app/.env b/app/.env new file mode 100644 index 0000000..1c9c594 --- /dev/null +++ b/app/.env @@ -0,0 +1 @@ +PUBLIC_ANALYTIC_SCRIPT="" diff --git a/app/src/app.html b/app/src/app.html index b858bee..addab35 100644 --- a/app/src/app.html +++ b/app/src/app.html @@ -5,7 +5,6 @@ - %sveltekit.head% Nodes {@render children?.()} + + + {#if config.ANALYTIC_SCRIPT} + {@html config.ANALYTIC_SCRIPT} + {/if} + diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index aee5f4b..0a98614 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -42,6 +42,25 @@ appSettings.value.debug.useWorker ? workerRuntime : memoryRuntime, ); + $effect(() => { + workerRuntime.useRegistryCache = + appSettings.value.debug.cache.useRuntimeCache; + workerRuntime.useRuntimeCache = + appSettings.value.debug.cache.useRegistryCache; + + if (appSettings.value.debug.cache.useRegistryCache) { + nodeRegistry.cache = registryCache; + } else { + nodeRegistry.cache = undefined; + } + + if (appSettings.value.debug.cache.useRuntimeCache) { + memoryRuntime.cache = runtimeCache; + } else { + memoryRuntime.cache = undefined; + } + }); + let activeNode = $state(undefined); let scene = $state(null!); diff --git a/packages/registry/src/node-registry-client.ts b/packages/registry/src/node-registry-client.ts index c034c94..464b6ac 100644 --- a/packages/registry/src/node-registry-client.ts +++ b/packages/registry/src/node-registry-client.ts @@ -15,7 +15,7 @@ export class RemoteNodeRegistry implements NodeRegistry { constructor( private url: string, - private cache?: AsyncCache, + public cache?: AsyncCache, ) { } async fetchJson(url: string, skipCache = false) {