(assetId)
| 3369 | } |
| 3370 | |
| 3371 | function deleteAsset(assetId) { |
| 3372 | if (!assetId) return; |
| 3373 | const used = (screens || []).some((scr) => (scr.elements || []).some((el) => el && el.assetId === assetId)); |
| 3374 | if (used) { |
| 3375 | alert("This asset is used by one or more elements. Remove those elements first (or change their asset) before deleting."); |
| 3376 | return; |
| 3377 | } |
| 3378 | assets = (assets || []).filter((a) => a && a.id !== assetId); |
| 3379 | renderAssets(); |
| 3380 | pushHistory(); |
| 3381 | } |
| 3382 | |
| 3383 | function removeUnusedAssets() { |
| 3384 | const used = new Set(); |
no test coverage detected