diff --git a/portal/menu-builder.html b/portal/menu-builder.html
index 6ff6a4e..20d880c 100644
--- a/portal/menu-builder.html
+++ b/portal/menu-builder.html
@@ -2848,17 +2848,21 @@
if (data.OK && data.MENU) {
this.menu = data.MENU;
console.log('[MenuBuilder] Menu categories:', this.menu.categories?.length || 0);
- // Store templates from API
- if (data.TEMPLATES) {
- this.templates = data.TEMPLATES;
- this.renderTemplateLibrary();
- }
+ // Store templates from API (default to empty array if not provided)
+ this.templates = data.TEMPLATES || [];
+ this.renderTemplateLibrary();
this.render();
} else {
console.log('[MenuBuilder] No MENU in response or OK=false');
+ // Still clear the loading message
+ this.templates = [];
+ this.renderTemplateLibrary();
}
} catch (err) {
console.error('[MenuBuilder] Error loading menu:', err);
+ // Clear loading message on error
+ this.templates = [];
+ this.renderTemplateLibrary();
}
},