From 9c2a090277c9b42e32ef5ecd9496e173abcfb9b9 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Wed, 20 Nov 2024 18:07:30 +0100 Subject: [PATCH] fix again to pass tests --- reflex/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 87ef2fac4..afc40e3b8 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -847,6 +847,10 @@ class App(MiddlewareMixin, LifespanMixin): (0, "AppWrap"): AppWrap.create() } + if self.theme is not None: + # If a theme component was provided, wrap the app with it + app_wrappers[(20, "Theme")] = self.theme + for route in self.unevaluated_pages: console.debug(f"Evaluating page: {route}") self._compile_page(route) @@ -1001,13 +1005,10 @@ class App(MiddlewareMixin, LifespanMixin): compile_results.append( compiler.compile_contexts(self.state, self.theme), ) - progress.advance(task) - if self.theme is not None: - # If a theme component was provided, wrap the app with it - app_wrappers[(20, "Theme")] = self.theme # Fix #2992 by removing the top-level appearance prop self.theme.appearance = None + progress.advance(task) # Compile the app root. compile_results.append(