fix: Improved the system notification feature so it can persist between modals
This commit is contained in:
+4
-7
@@ -2,11 +2,11 @@ use lidarr_handlers::LidarrHandler;
|
||||
use radarr_handlers::RadarrHandler;
|
||||
use sonarr_handlers::SonarrHandler;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::context_clues::{
|
||||
ContextClueProvider, ServarrContextClueProvider, SERVARR_CONTEXT_CLUES,
|
||||
ContextClueProvider, SERVARR_CONTEXT_CLUES, ServarrContextClueProvider,
|
||||
};
|
||||
use crate::app::key_binding::KeyBinding;
|
||||
use crate::app::App;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::keybinding_handler::KeybindingHandler;
|
||||
use crate::matches_key;
|
||||
@@ -116,7 +116,8 @@ pub fn handle_events(key: Key, app: &mut App<'_>) {
|
||||
} else {
|
||||
app.keymapping_table = None;
|
||||
}
|
||||
} else if matches_key!(esc, key) && handle_clear_notification(app) {
|
||||
} else if matches_key!(esc, key) && app.notification.is_some() {
|
||||
app.notification.take();
|
||||
} else {
|
||||
match app.get_current_route() {
|
||||
_ if app.keymapping_table.is_some() => {
|
||||
@@ -184,10 +185,6 @@ fn handle_clear_errors(app: &mut App<'_>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_clear_notification(app: &mut App<'_>) -> bool {
|
||||
app.notification.take().is_some()
|
||||
}
|
||||
|
||||
fn handle_prompt_toggle(app: &mut App<'_>, key: Key) {
|
||||
match key {
|
||||
_ if matches_key!(left, key) || matches_key!(right, key) => match app.get_current_route() {
|
||||
|
||||
Reference in New Issue
Block a user