fix(web): refresh does it even with no auto scroll

This commit is contained in:
əlemi 2024-08-13 20:27:35 +02:00
parent 0e309e143c
commit 100c738336
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 2 deletions

View file

@ -172,6 +172,7 @@ pub fn App() -> impl IntoView {
fn Scrollable() -> impl IntoView {
let location = use_location();
let feeds = use_context::<Feeds>().expect("missing feeds context");
let auth = use_context::<Auth>().expect("missing auth context");
let relevant_timeline = Signal::derive(move || {
let path = location.pathname.get();
if path.contains("/web/home") {
@ -225,7 +226,7 @@ fn Scrollable() -> impl IntoView {
<a class="breadcrumb mr-1" href="javascript:history.back()" ><b>"<<"</b></a>
<b>{crate::NAME}</b>" :: "{breadcrumb}
{move || relevant_timeline.get().map(|tl| view! {
<a class="breadcrumb ml-1" href="#" on:click=move|_| tl.refresh() ><b>""</b></a>
<a class="breadcrumb ml-1" href="#" on:click=move|_| tl.refresh(auth) ><b>""</b></a>
})}
</div>
<Outlet />

View file

@ -40,7 +40,7 @@ impl Timeline {
}
}
pub fn refresh(&self) {
pub fn refresh(&self, auth: Auth) {
self.reset(
self.next
.get_untracked()
@ -48,6 +48,7 @@ impl Timeline {
.next()
.map(|x| x.to_string())
);
self.spawn_more(auth);
}
pub fn spawn_more(&self, auth: Auth) {