Skip to content

Commit dc01695

Browse files
committed
fix: correctly check for NavigationData folder in package
1 parent 9cd3c39 commit dc01695

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/database/src/database.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ impl Database {
5959
}
6060

6161
pub fn set_active_database(&mut self, path: String) -> Result<(), Box<dyn Error>> {
62+
let path = match util::find_sqlite_file(&path) {
63+
Ok(new_path) => new_path,
64+
Err(_) => path,
65+
};
6266
println!("[NAVIGRAPH] Setting active database to {}", path);
6367
self.close_connection();
6468
if util::is_sqlite_file(&path)? {

src/wasm/src/dispatcher.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ impl<'a> Dispatcher<'a> {
137137

138138
fn set_database_if_exists(&mut self, path: &str) -> Result<(), Box<dyn Error>> {
139139
if path_exists(&Path::new(path)) {
140-
let sqlite_path = navigation_database::util::find_sqlite_file(path)?;
141-
self.database.set_active_database(sqlite_path)?;
142-
143-
Ok(())
140+
self.database.set_active_database(path.to_owned())
144141
} else {
145142
Err("Path does not exist".into())
146143
}

0 commit comments

Comments
 (0)