File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -786,7 +786,7 @@ def __init__(
786786
787787 self ._hover_effects_timer : Timer | None = None
788788
789- self ._css_update_count : int = - 1
789+ self ._css_update_count : int = 0
790790 """Incremented when CSS is invalidated."""
791791
792792 if self .ENABLE_COMMAND_PALETTE :
@@ -2213,6 +2213,8 @@ def _init_mode(self, mode: str) -> AwaitMount:
22132213 screen , await_mount = self ._get_screen (new_screen )
22142214 stack .append (screen )
22152215 self ._load_screen_css (screen )
2216+ if screen ._css_update_count != self ._css_update_count :
2217+ self .refresh_css ()
22162218
22172219 screen .post_message (events .ScreenResume ())
22182220 else :
@@ -2223,8 +2225,6 @@ def _init_mode(self, mode: str) -> AwaitMount:
22232225 screen .post_message (events .ScreenResume ())
22242226 await_mount = AwaitMount (stack [0 ], [])
22252227
2226- if screen ._css_update_count != self ._css_update_count :
2227- self .refresh_css ()
22282228 screen ._screen_resized (self .size )
22292229
22302230 self ._screen_stacks [mode ] = stack
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ def __init__(
267267 self .bindings_updated_signal : Signal [Screen ] = Signal (self , "bindings_updated" )
268268 """A signal published when the bindings have been updated"""
269269
270- self ._css_update_count = 0
270+ self ._css_update_count = - 1
271271 """Track updates to CSS."""
272272
273273 @property
You can’t perform that action at this time.
0 commit comments