diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ab118..0baa262 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Saving a feed's settings asks the database for your subscription once, not twice. - `ipx add` and Add feed in the page add a feed the same way, through one piece of code. - Glass's top bar is solid on a phone, in the colour its glass showed, so the strip above it on an iPhone can match it. - A pinned item or feed's pin button is filled with the theme's accent, in the reader, on the feed's page and in the toolbar, so pinned no longer looks like not pinned. diff --git a/src/web.rs b/src/web.rs index c7f5d7d..6d75737 100644 --- a/src/web.rs +++ b/src/web.rs @@ -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());