refactor(qconnect): simplify lifecycle_state JSON serialization

Drop the to_string->from_str round-trip in favor of a direct to_value
call. Same fallback behavior on serializer error.

cc
This commit is contained in:
vicrodh committed 2026-04-25 21:16:37 -06:00
1 parent 694f1a1044
commit 97ab63fd9b
1 file changed
+1 -4
+1 -4
View File
@@ -417,10 +417,7 @@ async fn update_lifecycle_state_if_running(
}
guard.lifecycle_state = next;
drop(guard);
let serialized = serde_json::to_string(&next)
.ok()
.and_then(|s| serde_json::from_str::<Value>(&s).ok())
.unwrap_or_else(|| json!("unknown"));
let serialized = serde_json::to_value(next).unwrap_or_else(|_| json!("unknown"));
let _ = app_handle.emit(
"qconnect:status_changed",
json!({