13 lines
386 B
Rust
13 lines
386 B
Rust
use paw_common::preclude::CoreConfig;
|
|
use tauri::AppHandle;
|
|
use tauri_plugin_store::StoreExt;
|
|
|
|
pub fn get_config(app: &AppHandle) -> anyhow::Result<CoreConfig> {
|
|
let store = app.store("core_config.json")?;
|
|
let value = store
|
|
.get("core_config")
|
|
.map(|v| serde_json::from_value(v.clone()).unwrap_or_default())
|
|
.unwrap_or_default();
|
|
anyhow::Ok(value)
|
|
}
|