Skip to content

Commit

Permalink
fix: assume assets in ../aw-webui/dist from root
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Apr 7, 2024
1 parent 10518bb commit 9805a2f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ fn main() {
let tray = create_tray();
tauri::Builder::default()
.setup(|_app| {
// TODO: build the web assets as part of the build process, instead of assuming they are there
let asset_path = PathBuf::from("../../aw-webui/dist");
let asset_path_opt = if asset_path.exists() {
Some(asset_path)
} else {
println!("Asset path does not exist: {:?}", asset_path);
println!("Running without assets");
None
};

let legacy_import = false;
let server_state = aw_server::endpoints::ServerState {
// Even if legacy_import is set to true it is disabled on Android so
// it will not happen there
datastore: Mutex::new(aw_datastore::Datastore::new(db_path, legacy_import)),
asset_resolver: aw_server::endpoints::AssetResolver::new(None),
asset_resolver: aw_server::endpoints::AssetResolver::new(asset_path_opt),
device_id,
};

Expand Down

0 comments on commit 9805a2f

Please sign in to comment.