This commit is contained in:
nvrl committed 2026-06-30 04:59:15 +02:00
1 parent f31633cb3a
commit 13d45ce6f5
1 file changed
+3 -5
+3 -5
View File
@@ -55,13 +55,11 @@ impl AppDirs {
/// Load config from disk, creating default if missing.
pub fn load_config(&self) -> AppConfig {
let path = self.config_path();
if path.exists() {
if let Ok(content) = std::fs::read_to_string(&path) {
if let Ok(config) = serde_json::from_str::<AppConfig>(&content) {
if path.exists()
&& let Ok(content) = std::fs::read_to_string(&path)
&& let Ok(config) = serde_json::from_str::<AppConfig>(&content) {
return config;
}
}
}
let default_config = AppConfig::default();
if let Ok(content) = serde_json::to_string_pretty(&default_config) {