diff --git a/web/src/app.rs b/web/src/app.rs index 6bd0b9e..f618371 100644 --- a/web/src/app.rs +++ b/web/src/app.rs @@ -17,6 +17,7 @@ pub fn App() -> impl IntoView { let home_tl = Timeline::new(format!("{URL_BASE}/users/{}/inbox/page", username.get().unwrap_or_default())); let server_tl = Timeline::new(format!("{URL_BASE}/inbox/page")); + let user_tl = Timeline::new(format!("{URL_BASE}/users/{}/outbox/page", username.get().unwrap_or_default())); let screen_width = window().screen().map(|x| x.avail_width().unwrap_or_default()).unwrap_or_default(); @@ -94,8 +95,8 @@ pub fn App() -> impl IntoView { - + } /> } /> diff --git a/web/src/page.rs b/web/src/page.rs index c3b6558..05bf398 100644 --- a/web/src/page.rs +++ b/web/src/page.rs @@ -31,7 +31,7 @@ pub fn ConfigPage() -> impl IntoView { } #[component] -pub fn UserPage() -> impl IntoView { +pub fn UserPage(tl: Timeline) -> impl IntoView { let params = use_params_map(); let auth = use_context::().expect("missing auth context"); let id = params.get().get("id").cloned().unwrap_or_default(); @@ -71,6 +71,10 @@ pub fn UserPage() -> impl IntoView { let following = object.following().get().map(|x| x.total_items().unwrap_or(0)).unwrap_or(0); let followers = object.followers().get().map(|x| x.total_items().unwrap_or(0)).unwrap_or(0); let statuses = object.outbox().get().map(|x| x.total_items().unwrap_or(0)).unwrap_or(0); + let tl_url = format!("{}/outbox/page", Uri::api("users", &id.clone(), false)); + if !tl.next.get().starts_with(&tl_url) { + tl.reset(tl_url); + } view! {
impl IntoView { }
- + }.into_view() }, }}