From 41b50eb893537d46b99fdb5e38338d0698a16f42 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Fri, 5 Dec 2025 23:54:31 -0500 Subject: [PATCH] remove decompress font cache --- src/math_app.rs | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/src/math_app.rs b/src/math_app.rs index f76e17d..c663f0f 100644 --- a/src/math_app.rs +++ b/src/math_app.rs @@ -135,15 +135,6 @@ impl MathApp { tracing::info!("Web Info: {:?}", &cc.integration_info.web_info); - fn get_storage_decompressed() -> Option> { - let data = get_localstorage().get_item(DATA_NAME).ok()??; - let cached_data = crate::misc::hashed_storage_read(&data)?; - - tracing::info!("Reading decompression cache. Bytes: {}", cached_data.len()); - return Some(cached_data); - - } - fn load_functions() -> Option { let data = get_localstorage().get_item(FUNC_NAME).ok()??; let func_data = crate::misc::hashed_storage_read(&data)?; @@ -173,17 +164,6 @@ impl MathApp { .read_to_end(&mut data) .expect("unable to read compressed data"); - #[cfg(target_arch = "wasm32")] - { - tracing::info!("Setting decompression cache"); - - let saved_data = crate::misc::hashed_storage_create(&data); - tracing::info!("Bytes: {}", saved_data.len()); - get_localstorage() - .set_item(DATA_NAME, saved_data) - .expect("failed to set local storage cache"); - } - bincode::deserialize(data.as_slice()).expect("unable to deserialize bincode") } @@ -191,19 +171,7 @@ impl MathApp { // Initialize fonts // This used to be in the `update` method, but (after a ton of digging) this actually caused OOMs. that was a pain to debug - cc.egui_ctx.set_fonts({ - #[cfg(target_arch = "wasm32")] - if let Some(Ok(data)) = - get_storage_decompressed().map(|data| bincode::deserialize(data.as_slice())) - { - data - } else { - decompress_fonts() - } - - #[cfg(not(target_arch = "wasm32"))] - decompress_fonts() - }); + cc.egui_ctx.set_fonts({ decompress_fonts() }); // Set dark mode by default // cc.egui_ctx.set_visuals(crate::style::style());