From 314422c96cb7407f9a618ec01cc9f33850a888e0 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Thu, 23 Apr 2026 17:01:03 +0000 Subject: [PATCH] Allow duplicate selected entries of the same name from different paths. --- frontend/src/stores/main.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/stores/main.ts b/frontend/src/stores/main.ts index 0266d74..060aeb2 100644 --- a/frontend/src/stores/main.ts +++ b/frontend/src/stores/main.ts @@ -378,22 +378,16 @@ export const useMainStore = defineStore('main', { // What did we not select? for (const key of selected) if (!found.has(key)) ret.missing.add(key) // Build a flat list including contents recursively - const relnames = new Set() - function add(rel: string, full: string, doc: Doc) { - if (!doc.dir && relnames.has(rel)) throw Error(`Multiple selections conflict for: ${rel}`) - relnames.add(rel) - ret.recursive.push([rel, full, doc]) - } for (const key of ret.keys) { const base = ret.docs[key]! const basepath = base.loc ? `${base.loc}/${base.name}` : base.name const nremove = base.loc.length - add(base.name, basepath, base) + ret.recursive.push([base.name, basepath, base]) for (const doc of docs) { if (doc.loc === basepath || doc.loc.startsWith(basepath) && doc.loc[basepath.length] === '/') { const full = doc.loc ? `${doc.loc}/${doc.name}` : doc.name const rel = full.slice(nremove) - add(rel, full, doc) + ret.recursive.push([rel, full, doc]) } } }