Compare commits

..

No commits in common. "e528f9e6840a789e4d3243d86e673e9db1c4169c" and "dbca9a98c8c4ed5d9d33541ce0d82137c144dfd5" have entirely different histories.

4 changed files with 3 additions and 23 deletions

View file

@ -305,13 +305,9 @@ pub fn TypeaheadInput(
// Only set initialized if component is still alive
if closures_clone.borrow().is_alive.load(Ordering::SeqCst) && !cancel_token.get() {
// Use a try_update to safely update the signal
if let Some(owner) = Owner::current() {
let _ = try_with_owner(owner, move || {
set_initialized.set(true);
});
} else {
log!("[INIT] No Leptos owner when setting initialized, aborting");
}
let _ = try_with_owner(Owner::current().unwrap(), move || {
set_initialized.set(true);
});
}
break;
}

View file

@ -3,8 +3,6 @@ pub mod components;
pub mod models;
pub mod nostr;
pub mod api;
pub mod utils;
#[cfg(feature = "ssr")]
pub mod db;

View file

@ -1,13 +0,0 @@
/// Utility to safely execute a closure with the current Leptos owner.
/// If the owner is disposed, logs and returns None.
pub fn with_owner_safe<F, R>(log_context: &str, f: F) -> Option<R>
where
F: FnOnce() -> R,
{
if let Some(owner) = leptos::Owner::current() {
leptos::try_with_owner(owner, f).ok()
} else {
leptos::logging::log!("[OWNER] No Leptos owner in context: {}", log_context);
None
}
}

View file

@ -1 +0,0 @@
pub mod leptos_owner;