fix: commit code
This commit is contained in:
1 parent
48fb4a6632
commit
a7991a32c5
1 file changed
+16
-16
+16
-16
@@ -33,23 +33,23 @@ pub async fn startup(config: CrateConfig) -> Result<()> {
|
||||
// file watcher: check file change
|
||||
let watcher_conf = config.clone();
|
||||
let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| {
|
||||
log::info!("Start to rebuild project...");
|
||||
if chrono::Local::now().timestamp() > last_update_time
|
||||
&& builder::build(&watcher_conf).is_ok()
|
||||
{
|
||||
// change the websocket reload state to true;
|
||||
// the page will auto-reload.
|
||||
if watcher_conf
|
||||
.dioxus_config
|
||||
.web
|
||||
.watcher
|
||||
.reload_html
|
||||
.unwrap_or(false)
|
||||
{
|
||||
let _ = Serve::regen_dev_page(&watcher_conf);
|
||||
if chrono::Local::now().timestamp() > last_update_time {
|
||||
log::info!("Start to rebuild project...");
|
||||
if builder::build(&watcher_conf).is_ok() {
|
||||
// change the websocket reload state to true;
|
||||
// the page will auto-reload.
|
||||
if watcher_conf
|
||||
.dioxus_config
|
||||
.web
|
||||
.watcher
|
||||
.reload_html
|
||||
.unwrap_or(false)
|
||||
{
|
||||
let _ = Serve::regen_dev_page(&watcher_conf);
|
||||
}
|
||||
let _ = reload_tx.send("reload".into());
|
||||
last_update_time = chrono::Local::now().timestamp();
|
||||
}
|
||||
let _ = reload_tx.send("reload".into());
|
||||
last_update_time = chrono::Local::now().timestamp();
|
||||
}
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
Reference in new issue
Block a user