MCPcopy
hub / github.com/stemdeckapp/stemdeck / restoreTrackFromTrash

Function restoreTrackFromTrash

static/js/catalog.js:866–879  ·  view source on GitHub ↗
(trackId)

Source from the content-addressed store, hash-verified

864}
865
866function restoreTrackFromTrash(trackId) {
867 if (!tracks[trackId]) return;
868 const trash = getTrashFolder();
869 if (!trash?.items.includes(trackId)) return;
870 trash.items = trash.items.filter((id) => id !== trackId);
871 let target = folders.find((f) => f.id !== TRASH_ID);
872 if (!target) {
873 target = makeFolder({ id: "f-unsorted", name: "Unsorted" });
874 folders.unshift(target);
875 }
876 if (!target.items.includes(trackId)) target.items.push(trackId);
877 saveState();
878 render();
879}
880
881function wireRailLibraryDrop() {
882 const btn = document.querySelector(".rail-library");

Callers 1

wireRailLibraryDropFunction · 0.85

Calls 4

getTrashFolderFunction · 0.85
makeFolderFunction · 0.85
saveStateFunction · 0.85
renderFunction · 0.70

Tested by

no test coverage detected