Move from ScrollBase to scroll module

`ScrollBase` is deprecated
This commit is contained in:
Henrik Friedrichsen
2022-01-13 21:09:26 +01:00
parent 06c6ea316e
commit adf8da2fc5
3 changed files with 65 additions and 32 deletions

View File

@@ -366,7 +366,8 @@ impl SearchResultsView {
// register paginator if the API has more than one page of results
if let Some(mut paginator) = paginator {
if total_items > results.read().unwrap().len() {
let loaded_items = results.read().unwrap().len();
if total_items > loaded_items {
let ev = ev.clone();
// paginator callback
@@ -375,7 +376,7 @@ impl SearchResultsView {
handler(&spotify, &results, &query, offset, true);
ev.trigger();
};
paginator.set(total_items, Box::new(cb));
paginator.set(loaded_items, total_items, Box::new(cb));
} else {
paginator.clear()
}