diff --git a/src/api/user.rs b/src/api/user.rs index f21fc9a..b8ab6dc 100644 --- a/src/api/user.rs +++ b/src/api/user.rs @@ -25,7 +25,7 @@ pub fn get_mentions(page: i64, unread_only: bool) -> std::result::Result std::result::Result { diff --git a/src/components/inbox_page.rs b/src/components/inbox_page.rs index bf93d4c..8d00cf4 100644 --- a/src/components/inbox_page.rs +++ b/src/components/inbox_page.rs @@ -92,6 +92,7 @@ impl SimpleComponent for InboxPage { let comments = match type_ { InboxType::Mentions => { if let Ok(response) = api::user::get_mentions(page, unread_only) { + // It's just a different object, but its contents are exactly the same let serialised = serde_json::to_string(&response.mentions).unwrap(); serde_json::from_str(&serialised).ok() } else { None } @@ -116,6 +117,7 @@ impl SimpleComponent for InboxPage { sender.input(InboxInput::FetchInbox); } InboxInput::UpdateInbox(comments) => { + self.mentions.guard().clear(); for comment in comments { self.mentions.guard().push_back(comment); } diff --git a/src/components/mention_row.rs b/src/components/mention_row.rs index 03d582c..22e33f9 100644 --- a/src/components/mention_row.rs +++ b/src/components/mention_row.rs @@ -41,6 +41,7 @@ impl FactoryComponent for MentionRow { set_margin_end: 10, set_margin_start: 10, set_margin_top: 10, + set_vexpand: false, gtk::Label { set_label: &self.comment.post.name,