diff --git a/server/src/graphql.rs b/server/src/graphql.rs index 18df894..744a4e4 100644 --- a/server/src/graphql.rs +++ b/server/src/graphql.rs @@ -41,6 +41,7 @@ pub enum Thread { #[derive(Debug, SimpleObject)] pub struct NewsPost { pub thread_id: String, + pub is_read: bool, pub slug: String, pub site: String, pub title: String, diff --git a/server/src/newsreader.rs b/server/src/newsreader.rs index 98cc60d..bdec610 100644 --- a/server/src/newsreader.rs +++ b/server/src/newsreader.rs @@ -207,6 +207,7 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result Result Node let avatar: Option = None; //let avatar: Option = Some(String::from("https://bulma.io/images/placeholders/64x64.png")); let id = post.thread_id.clone(); - // TODO: plumb this through - //let is_unread = has_unread(&msg.tags); - let is_unread = true; + let is_unread = !post.is_read; let img = render_avatar(avatar, &from); article![ C!["media"],