Do not allow search with empty value

This commit is contained in:
Jeremy Soller 2023-11-30 10:39:13 -07:00
parent 7d23b093fc
commit 1bc908b92f
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -922,6 +922,8 @@ impl Application for App {
return widget::text_input::focus(self.project_search_id.clone()); return widget::text_input::focus(self.project_search_id.clone());
} }
Message::ProjectSearchSubmit => { Message::ProjectSearchSubmit => {
//TODO: Figure out length requirements?
if !self.project_search_value.is_empty() {
//TODO: cache projects outside of nav model? //TODO: cache projects outside of nav model?
let mut project_paths = Vec::new(); let mut project_paths = Vec::new();
for id in self.nav_model.iter() { for id in self.nav_model.iter() {
@ -960,6 +962,7 @@ impl Application for App {
|x| x, |x| x,
); );
} }
}
Message::ProjectSearchValue(value) => { Message::ProjectSearchValue(value) => {
self.project_search_value = value; self.project_search_value = value;
} }