leptos_watch is not a bool

This commit is contained in:
Ben Wishovich 2022-12-24 10:30:29 -08:00
parent fbacfc787c
commit ff0d058a3e
2 changed files with 2 additions and 16 deletions

View File

@ -239,13 +239,7 @@ pub fn render_app_to_stream(
let site_ip = &options.site_address.ip().to_string();
let reload_port = options.reload_port;
let watch = match std::env::var("LEPTOS_WATCH").unwrap_or("false".to_string()).as_ref(){
"false" => false,
"true" => true,
_ => false,
};
let leptos_autoreload = match watch {
let leptos_autoreload = match std::env::var("LEPTOS_WATCH") {
true => format!(
r#"
<script crossorigin="">(function () {{

View File

@ -296,16 +296,8 @@ pub fn render_app_to_stream(
let site_ip = &options.site_address.ip().to_string();
let reload_port = options.reload_port;
let watch = match std::env::var("LEPTOS_WATCH")
.unwrap_or("false".to_string())
.as_ref()
{
"false" => false,
"true" => true,
_ => false,
};
let leptos_autoreload = match watch {
let leptos_autoreload = match std::env::var("LEPTOS_WATCH").is_ok() {
true => format!(
r#"
<script crossorigin="">(function () {{