fix: Resolve production issues in VPS environment

- Fix toggleCategory JavaScript error by adding null checks for productsGrid
- Fix product import persistence by changing from INSERT OR REPLACE to DELETE + INSERT
- Add automatic default product import on server startup when database is empty
- Ensure product data survives server restarts and imports

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marco Gallegos
2025-09-08 18:41:16 -06:00
parent 02f5775223
commit 8f22d7bc04
2 changed files with 100 additions and 23 deletions

4
app.js
View File

@@ -2300,10 +2300,10 @@ function toggleCategory(event) {
categorySection.classList.toggle('collapsed');
if (categorySection.classList.contains('collapsed')) {
productsGrid.style.display = 'none';
if (productsGrid) productsGrid.style.display = 'none';
toggle.textContent = '▶';
} else {
productsGrid.style.display = 'block';
if (productsGrid) productsGrid.style.display = 'block';
toggle.textContent = '▼';
}
}