This commit is contained in:
Simon Gardling
2023-03-07 13:12:57 -05:00
parent d134e918e4
commit 9a5cb8e5f8
5 changed files with 13 additions and 13 deletions

View File

@@ -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();
}
}
}

View File

@@ -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()??;