fix: initialize s3 file input if value already present

This commit is contained in:
Ruben Fiszel
2025-02-20 22:05:57 +01:00
parent d27cbdedce
commit 40c7fa890b
2 changed files with 26 additions and 0 deletions
@@ -746,6 +746,7 @@
}
}}
defaultValue={defaultValue?.s3}
initialValue={value}
/>
{/if}
</div>
@@ -32,6 +32,31 @@
export let fileUploads: Writable<FileUploadData[]> = writable([])
export let appPath: string | undefined = undefined
export let disabled = false
export let initialValue:
| {
s3: string
filename: string
}
| undefined = undefined
init()
function init() {
console.log('initialValues', initialValue)
if (initialValue) {
console.log('$fileUploads', $fileUploads)
if (!$fileUploads.find((fileUpload) => fileUpload.path === initialValue.s3)) {
$fileUploads = [
...$fileUploads,
{
name: initialValue.filename,
size: 0,
progress: 100,
path: initialValue.s3
}
]
}
}
}
export let computeForceViewerPolicies:
| (() =>
| {