diff --git a/frontend/src/lib/httpClient.ts b/frontend/src/lib/httpClient.ts index b9767a2..ee7a15e 100644 --- a/frontend/src/lib/httpClient.ts +++ b/frontend/src/lib/httpClient.ts @@ -15,11 +15,13 @@ const fetcher = async (url: string, opt?: RequestInit) => { } } - if (opt?.headers) { - opt.headers = { ...opt.headers, 'X-Authentication': jwt ?? '' } - } - - const res = await fetch(url, opt) + const res = await fetch(url, { + ...opt, + headers: { + ...opt?.headers, + 'X-Authentication': jwt ?? '' + } + }) if (!res.ok) { throw await res.text() diff --git a/frontend/src/views/Archive.tsx b/frontend/src/views/Archive.tsx index bb95aaa..cabdd3c 100644 --- a/frontend/src/views/Archive.tsx +++ b/frontend/src/views/Archive.tsx @@ -122,7 +122,7 @@ export default function Downloaded() { combineLatestWith(selected$), map(([data, selected]) => data.map(x => ({ ...x, - selected: selected.includes(x.path) + selected: selected.includes(x.name) }))), share() ), []) @@ -212,7 +212,7 @@ export default function Downloaded() { addSelected(file.path)} + onChange={() => addSelected(file.name)} /> }