- |
+ |
@@ -52,15 +51,17 @@ pub fn Object(object: serde_json::Value) -> impl IntoView {
}
#[component]
-pub fn ObjectInline(object: serde_json::Value, author: serde_json::Value) -> impl IntoView {
+pub fn ObjectInline(object: serde_json::Value) -> impl IntoView {
let summary = object.summary().unwrap_or_default().to_string();
let content = dissolve::strip_html_tags(object.content().unwrap_or_default());
+ let author_id = object.attributed_to().id().unwrap_or_default();
+ let author = CACHE.get_or(&author_id, serde_json::Value::String(author_id.clone()));
view! {
|
-
+
diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs
index 0efb05e3..c60d7483 100644
--- a/web/src/components/timeline.rs
+++ b/web/src/components/timeline.rs
@@ -1,6 +1,6 @@
-use std::collections::BTreeSet;
+use std::{collections::BTreeSet, pin::Pin};
-use apb::{Activity, Base};
+use apb::{Activity, Base, Object};
use leptos::*;
use crate::prelude::*;
@@ -55,10 +55,10 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView {
match CACHE.get(&id) {
Some(item) => match item.base_type() {
Some(apb::BaseType::Object(apb::ObjectType::Activity(_))) => {
- let author_id = item.actor().id().unwrap_or_default();
- let author = CACHE.get(&author_id).unwrap_or(serde_json::Value::String(author_id.clone()));
let object_id = item.object().id().unwrap_or_default();
- let object = CACHE.get(&object_id).map(|obj| view! { });
+ let object = CACHE.get(&object_id).map(|obj| {
+ view! { }
+ });
view! {
{object}
@@ -66,7 +66,7 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView {
}.into_view()
},
Some(apb::BaseType::Object(apb::ObjectType::Note)) => view! {
-
+
}.into_view(),
_ => view! { type not implemented
}.into_view(),
@@ -96,21 +96,28 @@ async fn process_activities(
auth: Signal | |