This commit is contained in:
Kelorastus
2026-09-16 11:42:24 +02:00
parent b7f3061be3
commit 3fdfde7043
18 changed files with 1485 additions and 21 deletions
+24
View File
@@ -7,6 +7,7 @@ use tauri_plugin_opener::OpenerExt;
use crate::launcher::{Launcher, Status};
use crate::settings::Settings;
use crate::stack::StackEvent;
use crate::sync::Conflict;
type CmdResult<T> = Result<T, String>;
@@ -89,6 +90,29 @@ pub async fn get_stack(launcher: State<'_, Launcher>) -> CmdResult<Vec<StackEven
Ok(launcher.stack_states())
}
#[tauri::command]
pub async fn sync_now(app: AppHandle, launcher: State<'_, Launcher>) -> CmdResult<()> {
launcher.sync_now(&app).await
}
#[tauri::command]
pub async fn get_sync_conflicts(app: AppHandle, launcher: State<'_, Launcher>) -> CmdResult<Vec<Conflict>> {
launcher.sync_conflicts(&app).await
}
/// `choice`: "theirs", "mine", "value" (with `value`) or "dismiss" (refused edits only).
#[tauri::command]
pub async fn resolve_sync_conflict(
app: AppHandle,
launcher: State<'_, Launcher>,
tbl: String,
key: serde_json::Value,
choice: String,
value: Option<serde_json::Value>,
) -> CmdResult<Vec<Conflict>> {
launcher.resolve_sync_conflict(&app, tbl, key, choice, value).await
}
#[tauri::command]
pub async fn get_settings(launcher: State<'_, Launcher>) -> CmdResult<Settings> {
Ok(launcher.settings().await)