mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
fix: correctly handle Action abort if it has already completed (closes #2740)
This commit is contained in:
parent
6cc0604497
commit
dcc43e574b
1 changed files with 4 additions and 5 deletions
|
@ -219,11 +219,10 @@ where
|
||||||
if let Some(owner) = &self.orig_owner {
|
if let Some(owner) = &self.orig_owner {
|
||||||
owner.with(|| {
|
owner.with(|| {
|
||||||
Owner::on_cleanup(move || {
|
Owner::on_cleanup(move || {
|
||||||
abort_tx.send(()).expect(
|
// If this fails, it is because the receiver has already dropped, i.e.,
|
||||||
"tried to cancel a future in \
|
// because the dispatched task has already completed. This means it can be
|
||||||
ArcAction::dispatch(), but the channel has \
|
// safely ignored, because it doesn't need to be aborted in any case.
|
||||||
already closed",
|
let _ = abort_tx.send(());
|
||||||
);
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue