fix target wasm cfg
This commit is contained in:
parent
65ab0c6a1f
commit
e497987573
@ -173,11 +173,11 @@ impl MathApp {
|
||||
.read_to_end(&mut data)
|
||||
.expect("unable to read compressed data");
|
||||
|
||||
#[cfg(target = "wasm32")]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
tracing::info!("Setting decompression cache");
|
||||
|
||||
let saved_data = hashed_storage_create(data);
|
||||
let saved_data = crate::misc::hashed_storage_create(&data);
|
||||
tracing::info!("Bytes: {}", saved_data.len());
|
||||
get_localstorage()
|
||||
.set_item(DATA_NAME, saved_data)
|
||||
@ -192,7 +192,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 = "wasm32")]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
if let Some(Ok(data)) =
|
||||
get_storage_decompressed().map(|data| bincode::deserialize(data.as_slice()))
|
||||
{
|
||||
@ -201,7 +201,7 @@ impl MathApp {
|
||||
decompress_fonts()
|
||||
}
|
||||
|
||||
#[cfg(not(target = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
decompress_fonts()
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user