mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
Only check suspense if the component aborted rendering
This commit is contained in:
parent
e751f63030
commit
cc984fae54
2 changed files with 7 additions and 6 deletions
|
@ -1,11 +1,10 @@
|
||||||
use std::{ panic::AssertUnwindSafe};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
innerlude::Scoped,
|
innerlude::Scoped,
|
||||||
nodes::RenderReturn,
|
nodes::RenderReturn,
|
||||||
scopes::{Scope, ScopeState},
|
scopes::{Scope, ScopeState},
|
||||||
Element,
|
Element,
|
||||||
};
|
};
|
||||||
|
use std::panic::AssertUnwindSafe;
|
||||||
|
|
||||||
/// A trait that essentially allows VComponentProps to be used generically
|
/// A trait that essentially allows VComponentProps to be used generically
|
||||||
///
|
///
|
||||||
|
|
|
@ -83,10 +83,12 @@ impl VirtualDom {
|
||||||
id: scope.id,
|
id: scope.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if scope.suspended.get() {
|
if matches!(allocated, RenderReturn::Aborted(_)) {
|
||||||
self.suspended_scopes.insert(scope.id);
|
if scope.suspended.get() {
|
||||||
} else if !self.suspended_scopes.is_empty() {
|
self.suspended_scopes.insert(scope.id);
|
||||||
_ = self.suspended_scopes.remove(&scope.id);
|
} else if !self.suspended_scopes.is_empty() {
|
||||||
|
_ = self.suspended_scopes.remove(&scope.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rebind the lifetime now that its stored internally
|
// rebind the lifetime now that its stored internally
|
||||||
|
|
Loading…
Reference in a new issue