Skip to content

Commit

Permalink
Re-add track deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Sep 25, 2024
1 parent 1076b70 commit 7b6c00d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/components/TrackList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,19 @@
}
}
async function delete_tracks(item_ids: ItemId[]) {
// const s = $selection.count > 1 ? 's' : ''
// const result = await ipc_renderer.invoke('showMessageBox', false, {
// type: 'info',
// message: `Delete ${$selection.count} song${s} from library?`,
// buttons: [`Delete Song${s}`, 'Cancel'],
// defaultId: 0,
// })
// if (result.response === 0) {
// delete_tracks_in_open(indexes)
// }
const s = selection.items.size > 1 ? 's' : ''
const result = await ipc_renderer.invoke('showMessageBox', false, {
type: 'info',
message: `Delete ${selection.items.size} song${s} from library?`,
buttons: [`Delete Song${s}`, 'Cancel'],
defaultId: 0,
})
if (result.response === 0) {
console.log('delete_tracks_with_item_ids(', item_ids)
delete_tracks_with_item_ids(item_ids)
console.log('deleted 👍')
}
}
async function keydown(e: KeyboardEvent) {
if (check_shortcut(e, 'Enter')) {
Expand Down Expand Up @@ -167,7 +170,7 @@
// }
} else if (check_shortcut(e, 'Backspace', { cmd_or_ctrl: true }) && $selection.size > 0) {
e.preventDefault()
// delete_tracks(selection.getSelectedIndexes())
handle_action('Delete from Library')
} else {
selection.handle_keydown(e)
return
Expand Down

0 comments on commit 7b6c00d

Please sign in to comment.