fix: need to merge tus metadata to file meta

This commit is contained in:
Derrick Hammer 2024-03-18 16:48:29 -04:00
parent 90f14b63e5
commit d1e059fd71
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 1 deletions

View File

@ -98,8 +98,13 @@ export function useUppy({
const file = uppyInstance.current?.getFile(fileID) as UppyFile const file = uppyInstance.current?.getFile(fileID) as UppyFile
// @ts-ignore // @ts-ignore
if (file.uploader === "tus") { if (file.uploader === "tus") {
const options = await sdk.protocols!().get<S5Client>(PROTOCOL_S5).getSdk().getTusOptions(file.data as File)
uppyInstance.current?.setFileState(fileID, { uppyInstance.current?.setFileState(fileID, {
tus: await sdk.protocols!().get<S5Client>(PROTOCOL_S5).getSdk().getTusOptions(file.data as File) tus: options,
meta: {
...options.metadata,
...file.meta,
}
}) })
} }
} }