mirror of
https://github.com/by-sonic/tglock.git
synced 2026-09-20 17:38:28 +03:00
fix(gui): return a result from asynchronous stop command
This commit is contained in:
@@ -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
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user