Ask for the subscription once when saving a feed's settings (#163)

patch_feed asked whether you subscribe, then asked again for the subscription, with a fallback for
none that could never run, since it only got there when there was one. One if-let does both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 01:55:33 +00:00
parent 4db5ee5c44
commit 2de5f81202
2 changed files with 2 additions and 6 deletions

View File

@@ -1574,12 +1574,7 @@ async fn patch_feed(
}
// What one person wants -- which items, whether to fetch them, how many at a time --
// is theirs. It goes on their subscription and nobody else sees the change.
if state.ctx.db.subscription(user.id, &id).await?.is_some() {
let mut mine = state
.ctx
.db
.subscription(user.id, &id).await?
.unwrap_or_else(|| crate::db::Sub { feed_id: id.clone(), ..Default::default() });
if let Some(mut mine) = state.ctx.db.subscription(user.id, &id).await? {
let mut touched = false;
if let Some(v) = body.keywords.clone() {
mine.keywords = Some(v.into_iter().filter(|k| !k.trim().is_empty()).collect());