Skip to content

Commit d3d47e9

Browse files
committed
re-order label/dir lists upon setting with dialog (#428)
1 parent ae109ed commit d3d47e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/popup/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export default function Home() {
3737

3838

3939
const handleSubmit = () => {
40-
const augmentedLabels = label && !labelOptions.includes(label) ? [label, ...labelOptions] : labelOptions;
41-
const augmentedDirectories = directory && !directoryOptions.includes(directory) ? [directory, ...directoryOptions] : directoryOptions;
40+
const augmentedLabels = [label, ...labelOptions.filter(x => x !== label)];
41+
const augmentedDirectories = [directory, ...directoryOptions.filter(x => x !== directory)];
4242
addTorrentCallback(webUi.id, torrent, label || null, directory || null, paused || false, augmentedLabels, augmentedDirectories).then(() => {
4343
window.close();
4444
});

0 commit comments

Comments
 (0)