summaryrefslogtreecommitdiff
path: root/crates/wipfel/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/wipfel/src/app.rs')
-rw-r--r--crates/wipfel/src/app.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/wipfel/src/app.rs b/crates/wipfel/src/app.rs
index 4194789..71cd168 100644
--- a/crates/wipfel/src/app.rs
+++ b/crates/wipfel/src/app.rs
@@ -550,7 +550,11 @@ pub fn app() -> Html {
},
_ => bytes,
};
- match pan.borrow_mut().load_data_from_bytes(&raw) {
+ // NOTE: the borrow must end before the match arm,
+ // which calls pan.borrow() itself (nested borrow
+ // would panic and trap the whole wasm module)
+ let res = pan.borrow_mut().load_data_from_bytes(&raw);
+ match res {
Ok(()) => {
markers.set(Vec::new());
track.set(Vec::new());