fix(typeahead_input): add check for valid Leptos owner before setting initialized state
This commit is contained in:
parent
dbca9a98c8
commit
a69c51921b
1 changed files with 7 additions and 3 deletions
|
@ -305,9 +305,13 @@ 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
|
||||
let _ = try_with_owner(Owner::current().unwrap(), move || {
|
||||
set_initialized.set(true);
|
||||
});
|
||||
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");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue