From 4260df8d10bfa300e3aa42d9dd318e8c275e71a4 Mon Sep 17 00:00:00 2001 From: One <43485962+c-git@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:44:48 -0400 Subject: [PATCH] feat: only take filename so it's wasm friendly --- src/app.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app.rs b/src/app.rs index 9d0dde0..ca1c33f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -294,12 +294,10 @@ impl LogViewerApp { return Box::new(LoadingStatus::NotInProgress); }; #[cfg(not(target_arch = "wasm32"))] - { - if let Some(parent) = file.path().parent() { - *start_open_path.lock().unwrap() = Some(PathBuf::from(parent)); - } - *last_filename.lock().unwrap() = Some(PathBuf::from(file.path())); + if let Some(parent) = file.path().parent() { + *start_open_path.lock().unwrap() = Some(PathBuf::from(parent)); } + *last_filename.lock().unwrap() = Some(PathBuf::from(file.file_name())); let text = file.read().await; // Uncomment the following line to simulate taking long to load, only works on native