fix(gui): return a result from asynchronous stop command

This commit is contained in:
babin
2026-09-19 15:19:14 +03:00
parent 54aa6dee97
commit 172c0d165d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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<StatusSnapshot, String> {
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<String, String> {