From 9c2dc7d847c99245d629762c4043bc9bd69fd7ca Mon Sep 17 00:00:00 2001 From: hrzlgnm Date: Wed, 30 Oct 2024 20:12:29 +0100 Subject: [PATCH] Tweaks --- shared_constants/src/lib.rs | 4 ++-- src-tauri/src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared_constants/src/lib.rs b/shared_constants/src/lib.rs index dfd609f..1cff5e9 100644 --- a/shared_constants/src/lib.rs +++ b/shared_constants/src/lib.rs @@ -1,6 +1,6 @@ use std::time::Duration; +pub const MDNS_SD_META_SERVICE: &str = "_services._dns-sd._udp.local."; pub const METRICS_CHECK_INTERVAL: Duration = Duration::from_secs(1); -pub const META_SERVICE: &str = "_services._dns-sd._udp.local."; pub const SPLASH_SCREEN_DURATION: Duration = Duration::from_secs(2); -pub const AUTO_COMPLETE_AUTO_FOCUS_DELAY: Duration = Duration::from_secs(3); +pub const AUTO_COMPLETE_AUTO_FOCUS_DELAY: Duration = Duration::from_secs(5); pub const SHOW_NO_UPDATE_DURATION: Duration = Duration::from_secs(3); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index b6bb5a1..67563cc 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -7,7 +7,7 @@ use serde::Serialize; #[cfg(not(debug_assertions))] use shared_constants::SPLASH_SCREEN_DURATION; -use shared_constants::{META_SERVICE, METRICS_CHECK_INTERVAL}; +use shared_constants::{MDNS_SD_META_SERVICE, METRICS_CHECK_INTERVAL}; use std::{ collections::HashMap, net::IpAddr, @@ -153,7 +153,7 @@ fn browse_types(window: Window, state: State) { let mdns_for_thread = mdns.clone(); std::thread::spawn(move || { let receiver = mdns_for_thread - .browse(META_SERVICE) + .browse(MDNS_SD_META_SERVICE) .expect("Failed to browse"); while let Ok(event) = receiver.recv() { match event { @@ -180,7 +180,7 @@ fn browse_types(window: Window, state: State) { .expect("To emit"); } ServiceEvent::SearchStopped(service_type) => { - if service_type == META_SERVICE { + if service_type == MDNS_SD_META_SERVICE { break; } }