Skip to main content

Mountain/IPC/StatusReporter/
mountain_attempt_recovery.rs

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