Fix localStorage quota by caching images before saving; add part copy button

This commit is contained in:
2026-04-20 01:30:36 +02:00
parent bcda0e7315
commit a771f3993e
5 changed files with 108 additions and 24 deletions
+4 -4
View File
@@ -67,17 +67,17 @@ export default function App() {
else { localStorage.removeItem(THEME_KEY); document.documentElement.removeAttribute('data-theme') }
}
function handleCreateFromTemplate(templateId: string) {
async function handleCreateFromTemplate(templateId: string) {
const existing = carts.find(c => c.templateId === templateId)
if (existing) { setActiveCart(existing.id); return }
const template = catalog?.templates.find(t => t.id === templateId)
if (!template) return
createCart(template.name, template)
await createCart(template.name, template)
}
function handleCreateEmpty() {
async function handleCreateEmpty() {
if (!newCartName.trim()) return
createCart(newCartName.trim())
await createCart(newCartName.trim())
setNewCartName('')
setShowNewCart(false)
}