diff --git a/bin/commands/patch/list.rs b/bin/commands/patch/list.rs index e442f226..ef5da133 100644 --- a/bin/commands/patch/list.rs +++ b/bin/commands/patch/list.rs @@ -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); diff --git a/bin/ui/items/patch.rs b/bin/ui/items/patch.rs index a10a8aec..6dd5c65b 100644 --- a/bin/ui/items/patch.rs +++ b/bin/ui/items/patch.rs @@ -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 {