summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/wipfel/src/app.rs6
-rw-r--r--dist/wipfel/wipfel_bg.wasmbin523275 -> 523275 bytes
2 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());
diff --git a/dist/wipfel/wipfel_bg.wasm b/dist/wipfel/wipfel_bg.wasm
index 13d92ec..0ab8fbc 100644
--- a/dist/wipfel/wipfel_bg.wasm
+++ b/dist/wipfel/wipfel_bg.wasm
Binary files differ