Fix bug in pagination when more than SEARCH_RESULTS_PER_PAGE returned
This commit is contained in:
parent
cdb64ed952
commit
3aa0b94db4
@ -12,7 +12,6 @@ use seed_hooks::{state_access::CloneState, topo, use_state};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
api::urls,
|
api::urls,
|
||||||
consts::SEARCH_RESULTS_PER_PAGE,
|
|
||||||
graphql::{front_page_query::*, show_thread_query::*},
|
graphql::{front_page_query::*, show_thread_query::*},
|
||||||
state::{unread_query, Model, Msg, RefreshingState},
|
state::{unread_query, Model, Msg, RefreshingState},
|
||||||
};
|
};
|
||||||
@ -308,7 +307,14 @@ fn search_toolbar(
|
|||||||
.start_cursor
|
.start_cursor
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|i| i.parse().unwrap_or(0))
|
.map(|i| i.parse().unwrap_or(0))
|
||||||
.unwrap_or(0);
|
.unwrap_or(0)
|
||||||
|
+ 1;
|
||||||
|
let end = pager
|
||||||
|
.end_cursor
|
||||||
|
.as_ref()
|
||||||
|
.map(|i| i.parse().unwrap_or(count))
|
||||||
|
.unwrap_or(count)
|
||||||
|
+ 1;
|
||||||
nav![
|
nav![
|
||||||
C!["level", "is-mobile"],
|
C!["level", "is-mobile"],
|
||||||
IF!(show_bulk_edit =>
|
IF!(show_bulk_edit =>
|
||||||
@ -377,12 +383,7 @@ fn search_toolbar(
|
|||||||
],
|
],
|
||||||
ul![
|
ul![
|
||||||
C!["pagination-list"],
|
C!["pagination-list"],
|
||||||
li![format!(
|
li![format!("{} - {} of {}", start, end, count)],
|
||||||
"{} - {} of {}",
|
|
||||||
start,
|
|
||||||
count.min(start + SEARCH_RESULTS_PER_PAGE),
|
|
||||||
count
|
|
||||||
)],
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user