diff --git a/Cargo.lock b/Cargo.lock index 245262a..7c46396 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1717,9 +1717,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "orbclient" -version = "0.3.42" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba683f1641c11041c59d5d93689187abcab3c1349dc6d9d70c550c9f9360802f" +checksum = "974465c5e83cf9df05c1e4137b271d29035c902e39e5ad4c1939837e22160af8" dependencies = [ "cfg-if", "redox_syscall 0.2.16", @@ -3127,6 +3127,7 @@ dependencies = [ "tracing-subscriber", "tracing-wasm", "wasm-bindgen", + "wasm-bindgen-futures", "web-sys", "zstd", ] diff --git a/Cargo.toml b/Cargo.toml index 2f9a28f..1b3282c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,6 +82,7 @@ wasm-bindgen = { version = "0.2", default-features = false, features = ["std"] } web-sys = "0.3" tracing-wasm = "0.2" getrandom = { version = "0.2", features = ["js"] } +wasm-bindgen-futures = "0.4.34" [package.metadata.cargo-all-features] skip_optional_dependencies = true #don't test optional dependencies, only features diff --git a/src/lib.rs b/src/lib.rs index f2a1fbb..3874e7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,22 +42,20 @@ cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { use wasm_bindgen::prelude::*; - use lol_alloc::FreeListAllocator; + use lol_alloc::{FreeListAllocator, LockedAllocator}; #[global_allocator] - static ALLOCATOR: FreeListAllocator = FreeListAllocator::new(); + static ALLOCATOR: LockedAllocator = LockedAllocator::new(FreeListAllocator::new()); #[wasm_bindgen(start)] - pub fn start() -> Result<(), wasm_bindgen::JsValue> { + pub async fn start() { tracing::info!("Starting..."); // Used in order to hook into `panic!()` to log in the browser's console tracing_wasm::set_as_global_default(); - eframe::start_web("canvas", eframe::WebOptions { - follow_system_theme: false, - default_theme: eframe::Theme::Dark - }, - Box::new(|cc| Box::new(math_app::MathApp::new(cc)))) + + eframe::start_web("canvas", eframe::WebOptions::default(), + Box::new(|cc| Box::new(math_app::MathApp::new(cc)))).await.unwrap(); } } } diff --git a/src/math_app.rs b/src/math_app.rs index b106b80..59ed52c 100644 --- a/src/math_app.rs +++ b/src/math_app.rs @@ -140,9 +140,7 @@ impl MathApp { if #[cfg(target_arch = "wasm32")] { use core::intrinsics::assume; - if let Some(web_info) = &cc.integration_info.web_info { - tracing::info!("Web Info: {:?}", web_info); - } + tracing::info!("Web Info: {:?}", &cc.integration_info.web_info); fn get_storage_decompressed() -> Option> { let data = get_localstorage().get_item(DATA_NAME).ok()??; diff --git a/www/index.html b/www/index.html index 7c0507d..a00ed26 100644 --- a/www/index.html +++ b/www/index.html @@ -46,6 +46,8 @@ overflow: hidden; margin: 0 !important; padding: 0 !important; + height: 100%; + width: 100%; } /* Position canvas in center-top: */