fix localstorage error
This commit is contained in:
@@ -150,10 +150,9 @@ impl MathApp {
|
||||
let data = get_localstorage().get_item(DATA_NAME).ok()??;
|
||||
let (commit, cached_data) = crate::misc::hashed_storage_read(&data)?;
|
||||
|
||||
|
||||
if commit == unsafe { std::mem::transmute::<&str, crate::misc::HashBytes>(build::SHORT_COMMIT) } {
|
||||
tracing::info!("Reading decompression cache. Bytes: {}", cached_data.len());
|
||||
return Some(cached_data.to_vec());
|
||||
return Some(cached_data);
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -161,14 +160,8 @@ impl MathApp {
|
||||
|
||||
fn load_functions() -> Option<FunctionManager> {
|
||||
let data = get_localstorage().get_item(FUNC_NAME).ok()??;
|
||||
if crate::misc::HASH_LENGTH >= data.len() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// TODO: stabilize FunctionManager serialize so it can persist across builds
|
||||
let (commit, func_data) = crate::misc::hashed_storage_read(&data)?;
|
||||
|
||||
|
||||
if commit == unsafe { std::mem::transmute::<&str, &[u8]>(build::SHORT_COMMIT) } {
|
||||
tracing::info!("Reading previous function data");
|
||||
let function_manager: FunctionManager = bincode::deserialize(&func_data).ok()?;
|
||||
|
||||
Reference in New Issue
Block a user