Compare commits

..

No commits in common. "2a6b6a88ae282b5c7937937cbeae11c4734aabd3" and "1cc41cced3f19473ac1caeabcd309d30cd3ee692" have entirely different histories.

4 changed files with 31 additions and 36 deletions

View file

@ -22,7 +22,7 @@ impl apb::server::Inbox for Context {
let object_model = self.insert_object(object_node, Some(server)).await?; let object_model = self.insert_object(object_node, Some(server)).await?;
let expanded_addressing = self.expand_addressing(activity_model.addressed()).await?; let expanded_addressing = self.expand_addressing(activity_model.addressed()).await?;
self.address_to(Some(activity_model.internal), Some(object_model.internal), &expanded_addressing).await?; self.address_to(Some(activity_model.internal), Some(object_model.internal), &expanded_addressing).await?;
tracing::info!("{} posted {}", activity_model.actor, object_model.id); tracing::info!("{} posted {}", activity_model.id, object_model.id);
Ok(()) Ok(())
} }

View file

@ -59,13 +59,9 @@ pub fn App() -> impl IntoView {
} }
server_tl.more(auth); server_tl.more(auth);
local_tl.more(auth);
if auth_present { home_tl.more(auth) }; if auth_present { home_tl.more(auth) };
}) })
} else { };
server_tl.more(auth);
local_tl.more(auth);
}
view! { view! {
<nav class="w-100 mt-1 mb-1 pb-s"> <nav class="w-100 mt-1 mb-1 pb-s">
@ -111,6 +107,8 @@ pub fn App() -> impl IntoView {
// in a sense it's what we want: refreshing the home tl is main purpose, but also // in a sense it's what we want: refreshing the home tl is main purpose, but also
// server tl may contain stuff we can no longer see, or otherwise we may now be // server tl may contain stuff we can no longer see, or otherwise we may now be
// entitled to see new posts. so while being ugly it's techically correct ig? // entitled to see new posts. so while being ugly it's techically correct ig?
{move || {
view! {
<main> <main>
<Routes> <Routes>
<Route path="/web" view=move || <Route path="/web" view=move ||
@ -123,7 +121,7 @@ pub fn App() -> impl IntoView {
<Route path="/web/home" view=move || view! { <TimelinePage name="home" tl=home_tl /> } /> <Route path="/web/home" view=move || view! { <TimelinePage name="home" tl=home_tl /> } />
<Route path="/web/server" view=move || view! { <TimelinePage name="server" tl=server_tl /> } /> <Route path="/web/server" view=move || view! { <TimelinePage name="server" tl=server_tl /> } />
<Route path="/web/local" view=move || view! { <TimelinePage name="local" tl=local_tl /> } /> <Route path="/web/local" view=move || view! { <TimelinePage name="server" tl=local_tl /> } />
<Route path="/web/about" view=AboutPage /> <Route path="/web/about" view=AboutPage />
<Route path="/web/config" view=move || view! { <ConfigPage setter=set_config /> } /> <Route path="/web/config" view=move || view! { <ConfigPage setter=set_config /> } />
@ -138,6 +136,8 @@ pub fn App() -> impl IntoView {
<Route path="/" view=move || view! { <Redirect path="/web" /> } /> <Route path="/" view=move || view! { <Redirect path="/web" /> } />
</Routes> </Routes>
</main> </main>
}
}}
</Router> </Router>
</div> </div>
</div> </div>

View file

@ -7,9 +7,6 @@ use apb::{target::Addressed, Base, Activity, Object};
#[component] #[component]
pub fn ActivityLine(activity: crate::Object) -> impl IntoView { pub fn ActivityLine(activity: crate::Object) -> impl IntoView {
let object_id = activity.object().id().unwrap_or_default(); let object_id = activity.object().id().unwrap_or_default();
let activity_url = activity.id().map(|x| view! {
<sup><small><a class="clean ml-s" href={x.to_string()} target="_blank">""</a></small></sup>
});
let actor_id = activity.actor().id().unwrap_or_default(); let actor_id = activity.actor().id().unwrap_or_default();
let actor = CACHE.get_or(&actor_id, serde_json::Value::String(actor_id.clone()).into()); let actor = CACHE.get_or(&actor_id, serde_json::Value::String(actor_id.clone()).into());
let kind = activity.activity_type().unwrap_or(apb::ActivityType::Activity); let kind = activity.activity_type().unwrap_or(apb::ActivityType::Activity);
@ -28,7 +25,6 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView {
<a class="upub-title clean" title={object_id} href={href} > <a class="upub-title clean" title={object_id} href={href} >
{kind.as_ref().to_string()} {kind.as_ref().to_string()}
</a> </a>
{activity_url}
<PrivacyMarker addressed=activity.addressed() /> <PrivacyMarker addressed=activity.addressed() />
</code> </code>
</span> </span>

View file

@ -37,8 +37,7 @@ impl Timeline {
} }
pub fn more(&self, auth: Auth) { pub fn more(&self, auth: Auth) {
if self.loading.get_untracked() { return } if self.loading.get() { return }
if self.over.get_untracked() { return }
let _self = *self; let _self = *self;
spawn_local(async move { spawn_local(async move {
_self.loading.set(true); _self.loading.set(true);
@ -151,8 +150,8 @@ pub fn TimelineFeed(tl: Timeline) -> impl IntoView {
let _auto_loader = create_local_resource( let _auto_loader = create_local_resource(
move || (scroll_debounced.get(), height.get()), move || (scroll_debounced.get(), height.get()),
move |(s, h)| async move { move |(s, h)| async move {
if !config.get_untracked().infinite_scroll { return } if !config.get().infinite_scroll { return }
if h - s < view_height { if s > 0.0 && h - s < view_height && !tl.loading.get() {
tl.more(auth); tl.more(auth);
} }
}, },