fix(comments): add error logging for check_pending_status failure
Address code quality review: log warnings when the server call fails instead of silently swallowing the error.
This commit is contained in:
parent
40cfd44d3a
commit
9e658662cb
@ -33,7 +33,8 @@ pub fn CommentSection(post_id: i32) -> Element {
|
|||||||
if ids.is_empty() {
|
if ids.is_empty() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if let Ok(statuses) = check_pending_status(ids).await {
|
match check_pending_status(ids).await {
|
||||||
|
Ok(statuses) => {
|
||||||
let to_remove: Vec<i64> = statuses
|
let to_remove: Vec<i64> = statuses
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|s| s.status != "pending")
|
.filter(|s| s.status != "pending")
|
||||||
@ -44,6 +45,10 @@ pub fn CommentSection(post_id: i32) -> Element {
|
|||||||
pending.write().retain(|c| !to_remove.contains(&c.id));
|
pending.write().retain(|c| !to_remove.contains(&c.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Err(e) => {
|
||||||
|
tracing::warn!("check_pending_status failed: {}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user