mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-29 14:30:31 +08:00
patch/list: Show state counters only wo/ state filter
This commit is contained in:
@@ -449,7 +449,7 @@ impl App {
|
||||
} => (counts.0, counts.1, counts.2, counts.3 + 1),
|
||||
});
|
||||
|
||||
if self.state.filter.is_default() {
|
||||
if !self.state.filter.has_state() {
|
||||
let draft = format!(" {} ", state_counts.0);
|
||||
let open = format!(" {} ", state_counts.1);
|
||||
let archived = format!(" {} ", state_counts.2);
|
||||
|
||||
@@ -170,6 +170,16 @@ pub mod filter {
|
||||
pub fn is_default(&self) -> bool {
|
||||
*self == PatchFilter::default()
|
||||
}
|
||||
|
||||
pub fn has_state(&self) -> bool {
|
||||
match self {
|
||||
PatchFilter::State(_) => true,
|
||||
PatchFilter::And(filters) => {
|
||||
filters.iter().any(|f| matches!(f, PatchFilter::State(_)))
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PatchFilter {
|
||||
|
||||
Reference in New Issue
Block a user