fix: save listeners, borrowed props, and pull back props

This commit is contained in:
Jonathan Kelley committed 2022-12-16 19:54:33 -08:00
1 parent b6a8391e07
commit 4d73ffa361
7 files changed
+237 -289

No files matched your search

+9 -3
View File
@@ -279,9 +279,10 @@ impl VirtualDom {
///
/// Whenever the VirtualDom "works", it will re-render this scope
pub fn mark_dirty(&mut self, id: ScopeId) {
let height = self.scopes[id.0].height;
self.dirty_scopes.insert(DirtyScope { height, id });
if let Some(scope) = self.scopes.get(id.0) {
let height = scope.height;
self.dirty_scopes.insert(DirtyScope { height, id });
}
}
/// Determine whether or not a scope is currently in a suspended state
@@ -545,6 +546,11 @@ impl VirtualDom {
if let Some(dirty) = self.dirty_scopes.iter().next().cloned() {
self.dirty_scopes.remove(&dirty);
// If the scope doesn't exist for whatever reason, then we should skip it
if !self.scopes.contains(dirty.id.0) {
continue;
}
// if the scope is currently suspended, then we should skip it, ignoring any tasks calling for an update
if self.is_scope_suspended(dirty.id) {
continue;