Skip to main content

Mountain/IPC/StatusReporter/
mountain_attempt_recovery.rs

1
2//! `mountain_attempt_recovery` Tauri command - dispose +
3//! reinitialise the IPC server and zero the error counter.
4
5use tauri::Manager;
6
7use crate::{IPC::StatusReporter::Reporter::Struct as Reporter, dev_log};
8
9#[tauri::command]
10pub async fn mountain_attempt_recovery(app_handle:tauri::AppHandle) -> Result<(), String> {
11	dev_log!("lifecycle", "Tauri command: attempt_recovery");
12
13	if let Some(reporter) = app_handle.try_state::<Reporter>() {
14		reporter.attempt_recovery().await
15	} else {
16		Err("StatusReporter not found in application state".to_string())
17	}
18}