mirror of
https://github.com/leptos-rs/leptos
synced 2024-09-20 06:21:57 +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 {
|
||||
owner.with(|| {
|
||||
Owner::on_cleanup(move || {
|
||||
abort_tx.send(()).expect(
|
||||
"tried to cancel a future in \
|
||||
ArcAction::dispatch(), but the channel has \
|
||||
already closed",
|
||||
);
|
||||
// If this fails, it is because the receiver has already dropped, i.e.,
|
||||
// because the dispatched task has already completed. This means it can be
|
||||
// safely ignored, because it doesn't need to be aborted in any case.
|
||||
let _ = abort_tx.send(());
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue