Only check suspense if the component aborted rendering

This commit is contained in:
Jonathan Kelley 2023-07-14 17:45:48 -07:00
parent e751f63030
commit cc984fae54
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
2 changed files with 7 additions and 6 deletions

View file

@ -1,11 +1,10 @@
use std::{ panic::AssertUnwindSafe};
use crate::{
innerlude::Scoped,
nodes::RenderReturn,
scopes::{Scope, ScopeState},
Element,
};
use std::panic::AssertUnwindSafe;
/// A trait that essentially allows VComponentProps to be used generically
///

View file

@ -83,10 +83,12 @@ impl VirtualDom {
id: scope.id,
});
if scope.suspended.get() {
self.suspended_scopes.insert(scope.id);
} else if !self.suspended_scopes.is_empty() {
_ = self.suspended_scopes.remove(&scope.id);
if matches!(allocated, RenderReturn::Aborted(_)) {
if scope.suspended.get() {
self.suspended_scopes.insert(scope.id);
} else if !self.suspended_scopes.is_empty() {
_ = self.suspended_scopes.remove(&scope.id);
}
}
// rebind the lifetime now that its stored internally