fix
This commit is contained in:
14
src/lib.rs
14
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<FreeListAllocator> = 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Vec<u8>> {
|
||||
let data = get_localstorage().get_item(DATA_NAME).ok()??;
|
||||
|
||||
Reference in New Issue
Block a user