Skip to content

Commit

Permalink
Fix startup sequence (#8)
Browse files Browse the repository at this point in the history
* fixed startup to grab default Mc instance

* Fixed the startup and removed inspect elements options.
  • Loading branch information
JakePIXL committed Oct 27, 2023
1 parent ae44805 commit 7d9d893
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
19 changes: 11 additions & 8 deletions teller/src/handlers/config/instance.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
collections::HashMap,
env,
ops::Add,
path::{Path, PathBuf},
Expand Down Expand Up @@ -71,21 +72,23 @@ pub fn get_local_directories_config<P: AsRef<Path>>(
Ok(s) => s,
Err(e) => {
error!("Could not load config file at {:?}: {:?}", config_path, e);
return Err(format!(
"Could not load config file at {:?}: {:?}",
config_path, e
));
let blank_data = DirectorySettings {
categories: HashMap::new(),
};
let rt = tokio::runtime::Runtime::new().unwrap();
return rt.block_on(create_local_directories_config(blank_data));
}
};

let parsed_settings = match settings.try_deserialize::<DirectorySettings>() {
Ok(s) => s,
Err(e) => {
error!("Could not parse config file at {:?}: {:?}", config_path, e);
return Err(format!(
"Could not parse config file at {:?}: {:?}",
config_path, e
));
let blank_data = DirectorySettings {
categories: HashMap::new(),
};
let rt = tokio::runtime::Runtime::new().unwrap();
return rt.block_on(create_local_directories_config(blank_data));
}
};

Expand Down
2 changes: 1 addition & 1 deletion teller_desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tauri-build = { version = "1.2.1", features = [] }
serde_json = "1.0"
serde = { version = "1.0.183", features = ["derive"] }

tauri = { version = "1.4", features = [ "shell-all", "window-all", "dialog-all", "http-all", "fs-all", "devtools"] }
tauri = { version = "1.4", features = [ "shell-all", "window-all", "dialog-all", "http-all", "fs-all"] }
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }

Expand Down
10 changes: 8 additions & 2 deletions teller_desktop/src/lib/modals/directories_modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@
{#if isOpen}
<div role="dialog" class="fixed inset-0 flex items-center justify-center z-50 py-2">
<div
class="card bg-slate-100 h-full min-w-[25rem] max-w-[66.666667%] max-h-[85%] overflow-auto"
class="card bg-slate-100 h-full w-full min-w-[25rem] max-w-[66.666667%] max-h-[85%] overflow-auto"
>
<div class="card-body">
<h2 class="card-title">Manage Local Instances</h2>
<div class="flex flex-col gap-2">
<h2 class="card-title">Manage Local Instances</h2>
<p class="text-sm">
Our system will attempt to find as many Minecraft instances within the directory
provided.
</p>
</div>
<button on:click={addDirectory} class="btn btn-secondary">Add Instance</button>

<div class="flex w-full">
Expand Down
2 changes: 1 addition & 1 deletion teller_desktop/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
},
vitePlugin: {
experimental: {
inspector: true
inspector: false
}
}
};
Expand Down

0 comments on commit 7d9d893

Please sign in to comment.