fix(web): follows/followers from newer to older
This commit is contained in:
parent
04ad3c84c2
commit
b6f4539424
1 changed files with 22 additions and 16 deletions
|
@ -32,22 +32,28 @@ pub fn FollowList(outgoing: bool) -> impl IntoView {
|
||||||
{move || match resource.get() {
|
{move || match resource.get() {
|
||||||
None => view! { <Loader /> }.into_view(),
|
None => view! { <Loader /> }.into_view(),
|
||||||
Some(Err(e)) => view! { <p class="center">could not load {follow___}: {e}</p> }.into_view(),
|
Some(Err(e)) => view! { <p class="center">could not load {follow___}: {e}</p> }.into_view(),
|
||||||
Some(Ok(arr)) => view! {
|
Some(Ok(mut arr)) => {
|
||||||
<For
|
// TODO cheap fix: server gives us follows from oldest to newest
|
||||||
each=move || arr.clone()
|
// but it's way more convenient to have them other way around
|
||||||
key=|id| id.clone()
|
// so we reverse them just after loading them
|
||||||
children=move |id| {
|
arr.reverse();
|
||||||
let actor = match cache::OBJECTS.get(&id) {
|
view! {
|
||||||
Some(x) => x,
|
<For
|
||||||
None => Arc::new(serde_json::Value::String(id)),
|
each=move || arr.clone()
|
||||||
};
|
key=|id| id.clone()
|
||||||
view! {
|
children=move |id| {
|
||||||
<ActorBanner object=actor />
|
let actor = match cache::OBJECTS.get(&id) {
|
||||||
<hr />
|
Some(x) => x,
|
||||||
}.into_view()
|
None => Arc::new(serde_json::Value::String(id)),
|
||||||
}
|
};
|
||||||
/ >
|
view! {
|
||||||
}.into_view(),
|
<ActorBanner object=actor />
|
||||||
|
<hr />
|
||||||
|
}.into_view()
|
||||||
|
}
|
||||||
|
/ >
|
||||||
|
}.into_view()
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue