diff --git a/public/js/app.js b/public/js/app.js index 70b7b6c..d012c50 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -494,7 +494,8 @@ async function confirmDelete(hashes) { /* ---------- add torrent modal ---------- */ function openAddModal() { - const cats = state.meta.categories.map((c) => ``).join(''); + const cats = '' + + state.meta.categories.map((c) => ``).join(''); openModal('Add torrent', `
@@ -689,7 +690,10 @@ function onRowContext(e, hash) { } function promptCategory() { - const opts = state.meta.categories.map((c) => ``).join(''); + const cur = state.snapshot?.torrents?.find((t) => t.hash === [...state.selected][0])?.category || ''; + const sel = (v) => (v === cur ? ' selected' : ''); + const opts = `` + + state.meta.categories.map((c) => ``).join(''); openModal('Set category', `

Need a new one? Use + next to “Categories” in the sidebar.

`,