mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-25 06:51:26 -03:00
fix(recipes): show initialization screen and auto-reload during first scan
The recipes page always rendered with is_initializing=False, so a cold start displayed an empty grid that never updated until a manual refresh. Mirror the model pages: gate render_page on the scanner state, broadcast init progress from RecipeScanner (including a completion message, and a failure fallback so the page never stalls), and teach initialization.js to detect the /loras/recipes page before the generic /loras match.
This commit is contained in:
@@ -176,11 +176,19 @@ class RecipePageView:
|
||||
user_language = self._settings.get("language", "en")
|
||||
self._server_i18n.set_locale(user_language)
|
||||
|
||||
# While the initial scan is running, show the initialization
|
||||
# screen (same as the model pages) instead of an empty grid; the
|
||||
# page reloads itself when the scanner broadcasts completion.
|
||||
is_initializing = (
|
||||
recipe_scanner._cache is None or recipe_scanner.is_initializing()
|
||||
)
|
||||
|
||||
try:
|
||||
await recipe_scanner.get_cached_data(force_refresh=False)
|
||||
if not is_initializing:
|
||||
await recipe_scanner.get_cached_data(force_refresh=False)
|
||||
rendered = self._template_env.get_template(self._template_name).render(
|
||||
recipes=[],
|
||||
is_initializing=False,
|
||||
is_initializing=is_initializing,
|
||||
settings=self._settings,
|
||||
request=request,
|
||||
t=self._server_i18n.get_translation,
|
||||
|
||||
Reference in New Issue
Block a user