diff --git a/public/glue.js b/public/glue.js index e15b9a9..e3bd0b5 100644 --- a/public/glue.js +++ b/public/glue.js @@ -8,7 +8,6 @@ export async function write_config_js(config) { return await invoke("write_config", { config: config }); } -export function load_config_js() { - console.log("AHHAHAH") - return invoke("load_config"); +export async function load_config_js() { + return await invoke("load_config"); } \ No newline at end of file diff --git a/src-tauri/config.toml b/src-tauri/config.toml index 41c2581..0b1e7dc 100644 --- a/src-tauri/config.toml +++ b/src-tauri/config.toml @@ -1,3 +1,3 @@ -cslol_dir = "WHY U RK" -wad_dir = "" +cslol_dir = "" +wad_dir = "C:\\Riot Games\\League of Legends\\Game\\DATA\\FINAL\\Champions" extract_dir = "" diff --git a/src-tauri/src/config_settings.rs b/src-tauri/src/config_settings.rs index d7f3c11..1eb06de 100644 --- a/src-tauri/src/config_settings.rs +++ b/src-tauri/src/config_settings.rs @@ -11,7 +11,6 @@ pub struct Config { #[tauri::command] pub async fn init_config() { - // Check if the config file exists asynchronously if fs::metadata("config.toml").is_err() { let config = Config { cslol_dir: "".to_string(), @@ -23,21 +22,18 @@ pub async fn init_config() { } #[tauri::command] -pub fn load_config() -> Config { +pub async fn load_config() -> Config { let config = fs::read_to_string("config.toml") .expect("Failed to read config.toml file"); - print!("COMMAND \n{}", config); toml::from_str(&config) .expect("Failed to parse config.toml file") } #[tauri::command] pub async fn write_config(config: Config) { - // Serialize the config synchronously (no async TOML serializer by default) let config_content = toml::to_string(&config) .expect("Failed to serialize config"); - // Write the config file asynchronously fs::write("config.toml", config_content) .expect("Failed to write to config.toml file"); } \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index a808485..8c3bc36 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,9 +1,8 @@ use wasm_bindgen::prelude::*; -use wasm_bindgen_futures::spawn_local; use yew::prelude::*; use yew_router::prelude::*; -use crate::{config_settings::init_config, views::*}; +use crate::views::*; #[wasm_bindgen] extern "C" { @@ -27,10 +26,14 @@ pub enum Route { #[function_component(App)] pub fn app() -> Html { + let fallback = html! {