Skip to content

Commit

Permalink
broke borrow cycle which caused borrow panic
Browse files Browse the repository at this point in the history
  • Loading branch information
jquesada2016 committed Sep 20, 2023
1 parent 59cdd47 commit 6ba8315
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions leptos_reactive/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,9 @@ pub fn try_with_owner<T>(owner: Owner, f: impl FnOnce() -> T) -> Option<T> {
runtime
.nodes
.try_borrow()
.map(|nodes| {
if nodes.contains_key(owner.0) {
.map(|nodes| nodes.contains_key(owner.0))
.map(|scope_exists| {
if scope_exists {
let prev_observer = runtime.observer.take();
let prev_owner = runtime.owner.take();

Expand Down

0 comments on commit 6ba8315

Please sign in to comment.