Fix localStorage quota by caching images before saving; add part copy button
This commit is contained in:
+4
-4
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user