From 38e21b9639babafe4c56bf82c1acccc256e833a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Thu, 28 Nov 2024 21:33:35 +0100 Subject: [PATCH] FIX: Small fix in app routing --- webapp/src/App.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index c8069f9..90d0d8a 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -33,7 +33,7 @@ function App() { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const modelHash = urlParams.get("model"); - const filename = urlParams.get("filename"); + const exampleFilename = urlParams.get("example"); // If there is a model name ?model=modelHash we try to load it // if there is not, or the loading failed we load an empty model if (modelHash) { @@ -46,15 +46,14 @@ function App() { } catch (e) { alert("Model not found, or failed to load"); } - } - if (filename) { + } else if (exampleFilename) { try { - const model_bytes = await get_documentation_model(filename); + const model_bytes = await get_documentation_model(exampleFilename); const importedModel = Model.from_bytes(model_bytes); localStorage.removeItem("selected"); setModel(importedModel); } catch (e) { - alert("Model not found, or failed to load"); + alert("Example file not found, or failed to load"); } } else { // try to load from local storage