From 172c0d165d5b4a53cfe35fb9623e6be41f69e587 Mon Sep 17 00:00:00 2001 From: babin Date: Sat, 19 Sep 2026 15:19:14 +0300 Subject: [PATCH] fix(gui): return a result from asynchronous stop command --- .github/workflows/ci.yml | 2 +- src/gui.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72744f1..8d8ef15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.88.0 + - uses: dtolnay/rust-toolchain@stable with: components: clippy - name: Lint CLI and core diff --git a/src/gui.rs b/src/gui.rs index 3ca5592..491367f 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -266,7 +266,7 @@ async fn start_proxy( } #[tauri::command] -async fn stop_proxy(state: State<'_, AppState>) -> StatusSnapshot { +async fn stop_proxy(state: State<'_, AppState>) -> Result { let mut task = state.task.lock().await; state.stats.stop(); if let Some(worker) = task.take() { @@ -275,7 +275,7 @@ async fn stop_proxy(state: State<'_, AppState>) -> StatusSnapshot { *state.active_listen.lock().unwrap() = None; *state.started_at.lock().unwrap() = None; state.log("Защита выключена", false); - state.snapshot() + Ok(state.snapshot()) } fn telegram_link(state: &AppState) -> Result {