huskies: merge 962

This commit is contained in:
dave
2026-05-13 11:58:50 +00:00
parent 658e02c9b2
commit 184c214c34
19 changed files with 204 additions and 44 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ pub fn set_name(story_id: &str, name: Option<&str>) -> bool {
/// other fields to be known.
///
/// Returns `true` if the item was found and the write was performed.
pub fn set_agent(story_id: &str, agent: Option<&str>) -> bool {
pub fn set_agent(story_id: &str, agent: Option<crate::config::AgentName>) -> bool {
let Some(state_mutex) = get_crdt() else {
return false;
};
@@ -157,7 +157,7 @@ pub fn set_agent(story_id: &str, agent: Option<&str>) -> bool {
let Some(&idx) = state.index.get(story_id) else {
return false;
};
let value = agent.unwrap_or("").to_string();
let value = agent.map(|a| a.as_str().to_string()).unwrap_or_default();
apply_and_persist(&mut state, |s| {
s.crdt.doc.items[idx].agent.set(value.clone())
});