feat(app): tauri get_config/set_config bridge commands
This commit is contained in:
@@ -327,3 +327,22 @@ pub async fn mark_read(state: BridgeState<'_>, target: Value) -> Result<Value, S
|
||||
pub async fn health(state: BridgeState<'_>) -> Result<Value, String> {
|
||||
data_of(state.request(Cmd::Health).await.map_err(|e| e.to_string())?)
|
||||
}
|
||||
|
||||
// ---- Settings commands ----
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_config(state: BridgeState<'_>) -> Result<Value, String> {
|
||||
data_of(state.request(Cmd::GetConfig).await.map_err(|e| e.to_string())?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn set_config(
|
||||
state: BridgeState<'_>,
|
||||
default_shell: Option<String>,
|
||||
font_family: Option<String>,
|
||||
font_size: Option<u16>,
|
||||
theme: Option<String>,
|
||||
accent: Option<String>,
|
||||
) -> Result<Value, String> {
|
||||
data_of(state.request(Cmd::SetConfig { default_shell, font_family, font_size, theme, accent }).await.map_err(|e| e.to_string())?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user