fix: accurately update number of pending action dispatches (closes #2652) (#2653)

This commit is contained in:
Oleg Shatov 2024-07-03 12:48:02 +02:00 committed by GitHub
parent fb5d8513ff
commit 0c817d51fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -392,7 +392,7 @@ where
let pending_dispatches = Rc::clone(&self.pending_dispatches);
let value = self.value;
pending.set(true);
pending_dispatches.set(pending_dispatches.get().saturating_sub(1));
pending_dispatches.set(pending_dispatches.get().wrapping_add(1));
spawn_local(async move {
let new_value = fut.await;
let res = try_batch(move || {