Load more fixes
This commit is contained in:
@@ -837,14 +837,18 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
|
||||
let handle_load_more = move |_| {
|
||||
let app_state = app_state.clone();
|
||||
if *app_state.scrolling.get() == true {
|
||||
app_state.scrollevent.set(true);
|
||||
}
|
||||
};
|
||||
|
||||
let callback: Closure<dyn FnMut()> = Closure::new(move || {
|
||||
//let csignal = csignal.clone();
|
||||
//csignal.set(true);
|
||||
let app_state2 = app_state2.clone();
|
||||
if *app_state2.scrolling.get() == true {
|
||||
app_state2.scrollevent.set(true);
|
||||
}
|
||||
info!("Got scroll event");
|
||||
});
|
||||
|
||||
@@ -874,6 +878,15 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
},
|
||||
key =|x| x.id )
|
||||
}
|
||||
br{}
|
||||
(if *app_state.maxpage.get() > 1 && *app_state.maxpage.get() > *app_state.pagedisplay.get() {
|
||||
view!{ cx,
|
||||
div(class="flex flex-col items-center"){
|
||||
button(class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center",on:click=handle_load_more){ "Load More" }
|
||||
}
|
||||
}} else {
|
||||
view!{ cx, ""}
|
||||
})
|
||||
}
|
||||
|
||||
} else if *app_state.openlibrary.get() == false && *app_state.editmode.get() == true {
|
||||
@@ -887,12 +900,6 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
},
|
||||
key =|x| x.id )
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
view!{cx, ""}
|
||||
}
|
||||
)
|
||||
br{}
|
||||
(if *app_state.maxpage.get() > 1 && *app_state.maxpage.get() > *app_state.pagedisplay.get() {
|
||||
view!{ cx,
|
||||
@@ -902,6 +909,13 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
}} else {
|
||||
view!{ cx, ""}
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
view!{cx, ""}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user