From f49fad1dabce757d39a870a7c4dfdb71da44d829 Mon Sep 17 00:00:00 2001 From: Grant Forrest Date: Mon, 30 Dec 2024 20:39:51 -0500 Subject: [PATCH] fix empty recipe description --- .../src/components/recipes/viewer/RecipeOverview.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/gnocchi/web/src/components/recipes/viewer/RecipeOverview.tsx b/apps/gnocchi/web/src/components/recipes/viewer/RecipeOverview.tsx index 9eda22c1..1ec979f5 100644 --- a/apps/gnocchi/web/src/components/recipes/viewer/RecipeOverview.tsx +++ b/apps/gnocchi/web/src/components/recipes/viewer/RecipeOverview.tsx @@ -184,7 +184,15 @@ function PreludeSection({ recipe }: { recipe: Recipe }) { const { prelude } = hooks.useWatch(recipe); hooks.useWatch(prelude); - if (prelude.get('content')?.length === 0) { + const empty = + !prelude || + !prelude.get('content') || + prelude + .get('content') + .getSnapshot() + .every((p: any) => !p.content); + + if (empty) { return null; }