only poll suspended futures
This commit is contained in:
1 parent
608fec59e5
commit
c9603ea984
7 files changed
+140
-46
No files matched your search
@@ -41,7 +41,6 @@ impl VirtualDom {
|
||||
let new_nodes = {
|
||||
let context = scope.state();
|
||||
|
||||
context.suspended.set(false);
|
||||
context.hook_index.set(0);
|
||||
|
||||
// Run all pre-render hooks
|
||||
@@ -70,12 +69,11 @@ impl VirtualDom {
|
||||
self.dirty_scopes
|
||||
.remove(&ScopeOrder::new(context.height, scope_id));
|
||||
|
||||
if context.suspended.get() {
|
||||
if let Some(task) = context.last_suspendable_task.take() {
|
||||
if matches!(new_nodes, RenderReturn::Aborted(_)) {
|
||||
self.suspended_scopes.insert(context.id);
|
||||
tracing::trace!("Suspending {:?} on {:?}", scope_id, task);
|
||||
self.runtime.suspended_tasks.borrow_mut().insert(task);
|
||||
}
|
||||
} else if !self.suspended_scopes.is_empty() {
|
||||
_ = self.suspended_scopes.remove(&context.id);
|
||||
}
|
||||
|
||||
self.runtime.scope_stack.borrow_mut().pop();
|
||||
|
||||
Reference in new issue
Block a user