web: go back to search page after changing read status
This commit is contained in:
parent
42ce88d931
commit
c2a5fe19e3
@ -150,6 +150,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
||||
}
|
||||
|
||||
Msg::SetUnread(query, unread) => {
|
||||
let search_url = urls::search(&model.query, 0).to_string();
|
||||
orders.skip().perform_cmd(async move {
|
||||
let res: Result<
|
||||
graphql_client::Response<graphql::mark_read_mutation::ResponseData>,
|
||||
@ -164,7 +165,11 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
||||
if let Err(e) = res {
|
||||
error!("Failed to set read for {query} to {unread}: {e}");
|
||||
}
|
||||
Msg::RefreshStart
|
||||
seed::window()
|
||||
.location()
|
||||
.set_href(&search_url)
|
||||
.expect("failed to change location");
|
||||
Msg::Noop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user