Skip to content

Commit 9ee4920

Browse files
committed
try getting it from the BASE_URL
1 parent 2c316a7 commit 9ee4920

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/python/pyodide_worker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ self.onmessage = async (event) => {
4242
// package itself. We need to set this as a global variable here, which lets
4343
// us do `import pyodide_js; pyodide_js.globals.get("BASE_URL")` (in the
4444
// `cache.py` file).
45-
let secondLastPart = window.location.pathname.split("/").slice(-2, -1)[0];
46-
self.pyodide.globals.set("DEMOLAND", secondLastPart);
45+
let model_identifier = BASE_URL.split("/").slice(-2, -1)[0];
46+
self.pyodide.globals.set("DEMOLAND", model_identifier);
4747

4848
try {
4949
await self.pyodide.loadPackagesFromImports(python);

0 commit comments

Comments
 (0)