fix(web): refresh does it even with no auto scroll
This commit is contained in:
parent
0e309e143c
commit
100c738336
2 changed files with 4 additions and 2 deletions
|
@ -172,6 +172,7 @@ pub fn App() -> impl IntoView {
|
||||||
fn Scrollable() -> impl IntoView {
|
fn Scrollable() -> impl IntoView {
|
||||||
let location = use_location();
|
let location = use_location();
|
||||||
let feeds = use_context::<Feeds>().expect("missing feeds context");
|
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 relevant_timeline = Signal::derive(move || {
|
||||||
let path = location.pathname.get();
|
let path = location.pathname.get();
|
||||||
if path.contains("/web/home") {
|
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>
|
<a class="breadcrumb mr-1" href="javascript:history.back()" ><b>"<<"</b></a>
|
||||||
<b>{crate::NAME}</b>" :: "{breadcrumb}
|
<b>{crate::NAME}</b>" :: "{breadcrumb}
|
||||||
{move || relevant_timeline.get().map(|tl| view! {
|
{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>
|
</div>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
|
|
|
@ -40,7 +40,7 @@ impl Timeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn refresh(&self) {
|
pub fn refresh(&self, auth: Auth) {
|
||||||
self.reset(
|
self.reset(
|
||||||
self.next
|
self.next
|
||||||
.get_untracked()
|
.get_untracked()
|
||||||
|
@ -48,6 +48,7 @@ impl Timeline {
|
||||||
.next()
|
.next()
|
||||||
.map(|x| x.to_string())
|
.map(|x| x.to_string())
|
||||||
);
|
);
|
||||||
|
self.spawn_more(auth);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn_more(&self, auth: Auth) {
|
pub fn spawn_more(&self, auth: Auth) {
|
||||||
|
|
Loading…
Reference in a new issue