Refactored to require handlers to specify the components they rely on and to specify when they are ready. This fixes a lot of bugs with the UI when users try to press buttons while the application is still loading.
This commit is contained in:
@@ -42,6 +42,10 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
self.key
|
||||
}
|
||||
|
||||
fn is_ready(&self) -> bool {
|
||||
!self.app.is_loading && self.app.data.radarr_data.indexer_settings.is_some()
|
||||
}
|
||||
|
||||
fn handle_scroll_up(&mut self) {
|
||||
let indexer_settings = self.app.data.radarr_data.indexer_settings.as_mut().unwrap();
|
||||
match self.active_radarr_block {
|
||||
|
||||
Reference in New Issue
Block a user