MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / deleteAsset

Function deleteAsset

app.js:3371–3381  ·  view source on GitHub ↗
(assetId)

Source from the content-addressed store, hash-verified

3369}
3370
3371function 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
3383function removeUnusedAssets() {
3384 const used = new Set();

Callers 1

renderAssetsFunction · 0.85

Calls 2

renderAssetsFunction · 0.85
pushHistoryFunction · 0.85

Tested by

no test coverage detected