Fix pagination and default homepage to unread search.
This commit is contained in:
parent
c62bac037f
commit
c3f897c61a
@ -22,9 +22,10 @@ const SEARCH_RESULTS_PER_PAGE: usize = 20;
|
||||
|
||||
// `init` describes what should happen when your app started.
|
||||
fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||
orders
|
||||
.subscribe(on_url_changed)
|
||||
.notify(subs::UrlChanged(url.clone()));
|
||||
if url.hash().is_none() {
|
||||
orders.request_url(urls::search("is:unread", 0));
|
||||
};
|
||||
orders.subscribe(on_url_changed);
|
||||
|
||||
Model {
|
||||
context: Context::None,
|
||||
@ -583,12 +584,8 @@ fn view_search_pager(start: usize, count: usize, total: usize) -> Node<Msg> {
|
||||
nav![
|
||||
C!["pagination"],
|
||||
a![
|
||||
C![
|
||||
"pagination-previous",
|
||||
"button",
|
||||
IF!(is_first => "is-static"),
|
||||
IF!(is_first => "is-info"),
|
||||
],
|
||||
C!["pagination-previous", "button",],
|
||||
IF!(is_first => attrs!{ At::Disabled=>true }),
|
||||
"<",
|
||||
ev(Ev::Click, |_| Msg::PreviousPage)
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user