forked from janek/mostr
feat: feedback when filter does not match
This commit is contained in:
parent
930c6b9c38
commit
3e056eb2b6
|
@ -406,13 +406,13 @@ async fn main() {
|
||||||
match arg {
|
match arg {
|
||||||
None => match tasks.get_position() {
|
None => match tasks.get_position() {
|
||||||
None => {
|
None => {
|
||||||
|
info!("Filtering for Procedures");
|
||||||
tasks.set_filter(
|
tasks.set_filter(
|
||||||
tasks.filtered_tasks(None)
|
tasks.filtered_tasks(None)
|
||||||
.filter(|t| t.pure_state() == State::Procedure)
|
.filter(|t| t.pure_state() == State::Procedure)
|
||||||
.map(|t| t.event.id)
|
.map(|t| t.event.id)
|
||||||
.collect()
|
.collect()
|
||||||
);
|
);
|
||||||
info!("Filtering for procedures");
|
|
||||||
}
|
}
|
||||||
Some(id) => {
|
Some(id) => {
|
||||||
tasks.set_state_for(id, "", State::Procedure);
|
tasks.set_state_for(id, "", State::Procedure);
|
||||||
|
|
|
@ -480,6 +480,9 @@ impl Tasks {
|
||||||
// Movement and Selection
|
// Movement and Selection
|
||||||
|
|
||||||
pub(crate) fn set_filter(&mut self, view: Vec<EventId>) {
|
pub(crate) fn set_filter(&mut self, view: Vec<EventId>) {
|
||||||
|
if view.is_empty() {
|
||||||
|
warn!("No match for filter!")
|
||||||
|
}
|
||||||
self.view = view;
|
self.view = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,7 +568,7 @@ impl Tasks {
|
||||||
if arg.len() > 2 {
|
if arg.len() > 2 {
|
||||||
Some(self.make_task(arg))
|
Some(self.make_task(arg))
|
||||||
} else {
|
} else {
|
||||||
warn!("Not creating task under 3 chars to avoid silly mistakes");
|
warn!("Name of a task needs to have at least 3 characters");
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue