@@ -95,17 +95,18 @@ impl App {
9595 let event_result = {
9696 let event_handler = self . event_handler . clone ( ) ;
9797 tokio:: task:: spawn_blocking ( move || event_handler. next_event ( ) )
98- } . await ;
98+ }
99+ . await ;
99100
100101 match event_result? {
101102 Ok ( event) => {
102103 // Only handle events that aren't None
103104 if event != AppEvent :: None {
104105 self . handle_event ( event) ;
105-
106+
106107 // Only redraw after handling a real event
107108 terminal. draw ( |f| self . draw ( f) ) ?;
108-
109+
109110 // Check if we should quit after handling the event
110111 if self . should_quit ( ) {
111112 break ;
@@ -144,38 +145,38 @@ impl App {
144145 }
145146 AppEvent :: NavigateUp => {
146147 // Only handle navigation in settings modal
147- if matches ! ( self . state, AppState :: Settings ) {
148- if let Some ( ref mut modal_state) = self . modal_state {
149- modal_state . navigate_up ( ) ;
150- // Apply live theme preview
151- let selected_theme = modal_state . selected_theme ( ) ;
152- self . theme . set_variant ( selected_theme) ;
153- }
148+ if matches ! ( self . state, AppState :: Settings )
149+ && let Some ( ref mut modal_state) = self . modal_state
150+ {
151+ modal_state . navigate_up ( ) ;
152+ // Apply live theme preview
153+ let selected_theme = modal_state . selected_theme ( ) ;
154+ self . theme . set_variant ( selected_theme ) ;
154155 }
155156 }
156157 AppEvent :: NavigateDown => {
157158 // Only handle navigation in settings modal
158- if matches ! ( self . state, AppState :: Settings ) {
159- if let Some ( ref mut modal_state) = self . modal_state {
160- modal_state . navigate_down ( ) ;
161- // Apply live theme preview
162- let selected_theme = modal_state . selected_theme ( ) ;
163- self . theme . set_variant ( selected_theme) ;
164- }
159+ if matches ! ( self . state, AppState :: Settings )
160+ && let Some ( ref mut modal_state) = self . modal_state
161+ {
162+ modal_state . navigate_down ( ) ;
163+ // Apply live theme preview
164+ let selected_theme = modal_state . selected_theme ( ) ;
165+ self . theme . set_variant ( selected_theme ) ;
165166 }
166167 }
167168 AppEvent :: Select => {
168169 // Only handle selection in settings modal
169- if matches ! ( self . state, AppState :: Settings ) {
170- if let Some ( ref modal_state) = self . modal_state {
171- let selected_theme = modal_state. selected_theme ( ) ;
172- let action = SettingsAction :: ChangeTheme ( selected_theme) ;
173- if let Err ( e) = self . handle_settings_action ( action) {
174- self . state = AppState :: Error ( format ! ( "Settings error: {}" , e) ) ;
175- }
176- // Close modal after selection
177- self . exit_settings ( ) ;
170+ if matches ! ( self . state, AppState :: Settings )
171+ && let Some ( ref modal_state) = self . modal_state
172+ {
173+ let selected_theme = modal_state. selected_theme ( ) ;
174+ let action = SettingsAction :: ChangeTheme ( selected_theme) ;
175+ if let Err ( e) = self . handle_settings_action ( action) {
176+ self . state = AppState :: Error ( format ! ( "Settings error: {}" , e) ) ;
178177 }
178+ // Close modal after selection
179+ self . exit_settings ( ) ;
179180 }
180181 }
181182 AppEvent :: SettingsAction ( action) => {
@@ -225,10 +226,10 @@ impl App {
225226 self . render_footer ( frame, layout_rects. footer ) ;
226227
227228 // Render modal overlay if in settings state
228- if matches ! ( self . state, AppState :: Settings ) {
229- if let Some ( ref modal_state) = self . modal_state {
230- crate :: settings :: render_settings_modal ( frame , size , modal_state , & self . theme ) ;
231- }
229+ if matches ! ( self . state, AppState :: Settings )
230+ && let Some ( ref modal_state) = self . modal_state
231+ {
232+ crate :: settings :: render_settings_modal ( frame , size , modal_state , & self . theme ) ;
232233 }
233234 }
234235
0 commit comments