diff --git a/kitchen/src/web/mod.rs b/kitchen/src/web/mod.rs index 5cd3aab..a1b8fdc 100644 --- a/kitchen/src/web/mod.rs +++ b/kitchen/src/web/mod.rs @@ -69,16 +69,18 @@ async fn ui_static_assets(Path(path): Path) -> impl IntoResponse { info!("Serving ui path"); let mut path = path.trim_start_matches("/"); - path = match path { - "" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html", - _ => { - if path.starts_with("recipe") { - "index.html" - } else { - path + if UiAssets::get(path).is_none() { + path = match path { + "" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html", + _ => { + if path.starts_with("recipe") { + "index.html" + } else { + path + } } - } - }; + }; + } debug!(path = path, "Serving transformed path"); StaticFile(path.to_owned()) } diff --git a/web/src/web.rs b/web/src/web.rs index 1751d8d..773969c 100644 --- a/web/src/web.rs +++ b/web/src/web.rs @@ -67,7 +67,6 @@ pub fn UI(cx: Scope) -> View { }; view.set(view! { cx, div(class="app") { - Header() Router(RouterProps { route: Routes::Plan, route_select: route_switch,