Refactored the ErrorMessage widget into a generic Message widget for enhanced reuse. Added support for testing a single indexer at a time.

This commit is contained in:
2024-02-15 11:11:10 -07:00
parent b49bfaa9c1
commit a360c83431
23 changed files with 418 additions and 78 deletions
@@ -152,6 +152,10 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexersHandler<'a,
self.app.pop_navigation_stack();
self.app.data.radarr_data.prompt_confirm = false;
}
ActiveRadarrBlock::TestIndexer => {
self.app.pop_navigation_stack();
self.app.data.radarr_data.indexer_test_error = None;
}
_ => handle_clear_errors(self.app),
}
}
@@ -169,6 +173,11 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexersHandler<'a,
self.app.should_refresh = true;
}
_ if *key == DEFAULT_KEYBINDINGS.test.key => {
self
.app
.push_navigation_stack(ActiveRadarrBlock::TestIndexer.into());
}
_ if *key == DEFAULT_KEYBINDINGS.test_all.key => {
self
.app
.push_navigation_stack(ActiveRadarrBlock::TestAllIndexers.into());