You've already forked AstralRinth
forked from didirus/AstralRinth
added settings API + fixed bug (#62)
* added settings API + fixed bug * removed redundant API funcs * comment clarifications --------- Co-authored-by: Wyatt <wyatt@modrinth.com>
This commit is contained in:
@@ -6,6 +6,7 @@ pub mod auth;
|
||||
|
||||
pub mod profile;
|
||||
pub mod profile_create;
|
||||
pub mod settings;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, TheseusGuiError>;
|
||||
|
||||
|
||||
17
theseus_gui/src-tauri/src/api/settings.rs
Normal file
17
theseus_gui/src-tauri/src/api/settings.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::api::Result;
|
||||
use theseus::prelude::*;
|
||||
|
||||
// Get full settings
|
||||
// invoke('settings_get')
|
||||
#[tauri::command]
|
||||
pub async fn settings_get() -> Result<Settings> {
|
||||
Ok(settings::get().await?)
|
||||
}
|
||||
|
||||
// Set full settings
|
||||
// invoke('settings_set', settings)
|
||||
#[tauri::command]
|
||||
pub async fn settings_set(settings: Settings) -> Result<()> {
|
||||
settings::set(settings).await?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user