From 8f68585c1fdee7e189ec607814add9f108778831 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 31 Jan 2024 16:04:44 -0600 Subject: [PATCH] fix the default server fullstack history --- packages/router/src/router_cfg.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/router/src/router_cfg.rs b/packages/router/src/router_cfg.rs index e592aa841..1642f79c7 100644 --- a/packages/router/src/router_cfg.rs +++ b/packages/router/src/router_cfg.rs @@ -54,7 +54,7 @@ macro_rules! default_history { return Box::new(AnyHistoryProviderImplWrapper::new(WebHistory::::default())); // If we are using dioxus fullstack and the ssr feature is enabled, use the memory history with the initial path set to the current path in fullstack #[cfg(all(feature = "fullstack", feature = "ssr"))] - return MemoryHistory::with_initial_path( + return Box::new(AnyHistoryProviderImplWrapper::new(MemoryHistory::::with_initial_path( dioxus_fullstack::prelude::server_context() .request_parts() .unwrap() @@ -69,7 +69,7 @@ macro_rules! default_history { panic!("Failed to parse uri: {}", err); }) }), - ); + ))); // If we are not on wasm32 and the liveview feature is enabled, use the liveview history. #[cfg(all(feature = "liveview"))] return Box::new(AnyHistoryProviderImplWrapper::new(LiveviewHistory::new_with_initial_path($initial_route))); @@ -91,9 +91,9 @@ where { pub(crate) fn get_history(self) -> Box> { #[allow(unused)] - let initial_route = self.initial_route.clone().unwrap_or("/".parse().unwrap_or_else(|err| - panic!("index route does not exist:\n{}\n use MemoryHistory::with_initial_path or RouterConfig::initial_route to set a custom path", err) - )); + let initial_route = self.initial_route.clone().unwrap_or("/".parse().unwrap_or_else(|err| + panic!("index route does not exist:\n{}\n use MemoryHistory::with_initial_path or RouterConfig::initial_route to set a custom path", err) + )); self.history .take() .unwrap_or_else(|| default_history!(initial_route)) @@ -122,9 +122,9 @@ where { pub(crate) fn take_history(&mut self) -> Box { #[allow(unused)] - let initial_route = self.initial_route.clone().unwrap_or("/".parse().unwrap_or_else(|err| - panic!("index route does not exist:\n{}\n use MemoryHistory::with_initial_path or RouterConfig::initial_route to set a custom path", err) - )); + let initial_route = self.initial_route.clone().unwrap_or("/".parse().unwrap_or_else(|err| + panic!("index route does not exist:\n{}\n use MemoryHistory::with_initial_path or RouterConfig::initial_route to set a custom path", err) + )); self.history .take() .unwrap_or_else(|| default_history!(initial_route))