web: add mark as spam button to catchup mode
This commit is contained in:
@@ -692,6 +692,13 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
};
|
};
|
||||||
orders.send_msg(Msg::CatchupNext);
|
orders.send_msg(Msg::CatchupNext);
|
||||||
}
|
}
|
||||||
|
Msg::CatchupMarkAsSpam => {
|
||||||
|
if let Some(thread_id) = current_thread_id(&model.context) {
|
||||||
|
orders.send_msg(Msg::AddTag(thread_id.clone(), "Spam".to_string()));
|
||||||
|
orders.send_msg(Msg::SetUnread(thread_id, false));
|
||||||
|
};
|
||||||
|
orders.send_msg(Msg::CatchupNext);
|
||||||
|
}
|
||||||
Msg::CatchupNext => {
|
Msg::CatchupNext => {
|
||||||
orders.send_msg(Msg::ScrollToTop);
|
orders.send_msg(Msg::ScrollToTop);
|
||||||
let Some(catchup) = &mut model.catchup else {
|
let Some(catchup) = &mut model.catchup else {
|
||||||
@@ -902,6 +909,7 @@ pub enum Msg {
|
|||||||
CatchupStart,
|
CatchupStart,
|
||||||
CatchupKeepUnread,
|
CatchupKeepUnread,
|
||||||
CatchupMarkAsRead,
|
CatchupMarkAsRead,
|
||||||
|
CatchupMarkAsSpam,
|
||||||
CatchupNext,
|
CatchupNext,
|
||||||
CatchupExit,
|
CatchupExit,
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,14 @@ fn catchup_view(
|
|||||||
Msg::GoToSearchResults
|
Msg::GoToSearchResults
|
||||||
]))
|
]))
|
||||||
],
|
],
|
||||||
|
button![
|
||||||
|
tw_classes::button(),
|
||||||
|
C!["text-red-500"],
|
||||||
|
attrs! {At::Title => "Mark as spam"},
|
||||||
|
span![i![C!["far", "fa-hand"]]],
|
||||||
|
span![C!["pl-2"], "Spam"],
|
||||||
|
ev(Ev::Click, |_| Msg::CatchupMarkAsSpam)
|
||||||
|
],
|
||||||
button![
|
button![
|
||||||
tw_classes::button_with_color("bg-green-800", "hover:bg-green-700"),
|
tw_classes::button_with_color("bg-green-800", "hover:bg-green-700"),
|
||||||
span![i![C!["far", "fa-envelope-open"]]],
|
span![i![C!["far", "fa-envelope-open"]]],
|
||||||
|
|||||||
Reference in New Issue
Block a user