Skip to main content

Mountain/IPC/StatusReporter/
mountain_attempt_recovery.rs

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