Merge branch 'upstream' into fix-hot-reloading

This commit is contained in:
Evan Almloff committed 2022-12-19 21:17:22 -06:00
commit 493ee1cb3f
42 files changed
+2007 -926

No files matched your search

+9 -2
View File
@@ -279,8 +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
@@ -565,6 +567,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;