fix conditional compilation for hot reloading

This commit is contained in:
Evan Almloff committed 2023-02-07 08:57:29 -06:00
1 parent e2a73127f3
commit 773a87d701
4 files changed
+25 -14

No files matched your search

+11 -10
View File
@@ -134,7 +134,7 @@ where
#[cfg(all(feature = "hot-reload", debug_assertions))]
let hot_reload_wait = hot_reload_rx.recv();
#[cfg(not(all(feature = "hot-reload", debug_assertions)))]
let hot_reload_wait = std::future::pending();
let hot_reload_wait: std::future::Pending<Option<()>> = std::future::pending();
tokio::select! {
// poll any futures or suspense
@@ -157,17 +157,18 @@ where
}
}
msg = hot_reload_wait => {
if let Some(msg) = msg {
match msg{
dioxus_hot_reload::HotReloadMsg::UpdateTemplate(new_template) => {
vdom.replace_template(new_template);
}
dioxus_hot_reload::HotReloadMsg::Shutdown => {
std::process::exit(0);
},
Some(msg) = hot_reload_wait => {
#[cfg(all(feature = "hot-reload", debug_assertions))]
match msg{
dioxus_hot_reload::HotReloadMsg::UpdateTemplate(new_template) => {
vdom.replace_template(new_template);
}
dioxus_hot_reload::HotReloadMsg::Shutdown => {
std::process::exit(0);
},
}
#[cfg(not(all(feature = "hot-reload", debug_assertions)))]
let () = msg;
}
}