Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion desktop/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@tauri-apps/plugin-shell": "^2.3.3",
"@types/node": "^25.5.0",
"koa": "^2.16.1",
"markdown-it": "^14.2.0",
"markdown-it": "^14.3.1",
"micromark": "^4.0.1",
"nuxt": "^4.5.1",
"scss": "^0.2.4",
Expand Down
22 changes: 19 additions & 3 deletions desktop/main/pages/settings/downloads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
</div>
</div>
<TransitionRoot as="template" :show="open">
<Dialog class="relative z-50" @close="open = false">
<Dialog class="relative z-50" @close="cancelDirectory">
<TransitionChild as="template" enter="ease-out duration-300" enter-from="opacity-0" enter-to="opacity-100"
leave="ease-in duration-200" leave-from="opacity-100" leave-to="opacity-0">
<div class="fixed inset-0 bg-zinc-950 bg-opacity-75 transition-opacity" />
Expand Down Expand Up @@ -135,7 +135,17 @@
</button>
</div>
<p class="mt-2 text-sm text-zinc-400" id="dir-description">
Select an empty directory to add.
Choose an empty directory, or allow a non-empty one below.
</p>
<div class="mt-4 flex items-start gap-2">
<input id="allow-non-empty" v-model="allowNonEmpty" type="checkbox"
class="mt-1 rounded border-zinc-600 bg-zinc-800 text-blue-600 focus:ring-blue-600" />
<label for="allow-non-empty" class="text-sm text-zinc-300">
Allow a non-empty directory
</label>
</div>
<p class="mt-3 text-sm text-amber-300">
Drop may delete folders and files in this directory, including items you created manually.
</p>
</div>
</div>
Expand Down Expand Up @@ -190,6 +200,7 @@ import { type Settings } from "~/types";

const open = ref(false);
const currentDirectory = ref<string | undefined>(undefined);
const allowNonEmpty = ref(false);
const error = ref<string | undefined>(undefined);
const createDirectoryLoading = ref(false);

Expand Down Expand Up @@ -231,6 +242,7 @@ async function selectDirectory() {
function cancelDirectory() {
open.value = false;
currentDirectory.value = undefined;
allowNonEmpty.value = false;
}

async function submitDirectory() {
Expand All @@ -241,12 +253,16 @@ async function submitDirectory() {
createDirectoryLoading.value = true;

// Add directory
await invoke("add_download_dir", { newDir: currentDirectory.value });
await invoke("add_download_dir", {
newDir: currentDirectory.value,
allowNonEmpty: allowNonEmpty.value,
});

// Update list
await updateDirs();

currentDirectory.value = undefined;
allowNonEmpty.value = false;
createDirectoryLoading.value = false;
open.value = false;
} catch (e) {
Expand Down
Loading
Loading