Skip to content

Commit

Permalink
Merge branch 'dev' into add_friend_link
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored Dec 3, 2024
2 parents a4c0a9c + efb0772 commit 7cbb8b0
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/routes/files/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@
search_component.select_first()
}
const onFileSelected = async (e: Event) => {
const target = e.target as HTMLInputElement
const onFileSelected = async (target: HTMLInputElement) => {
if (target && target.files) {
for (let i = 0; i < target.files.length; i++) {
const file = target.files[i]
Expand Down Expand Up @@ -627,12 +626,24 @@
hook="button-upload-file"
icon
tooltip={$_("files.upload")}
on:click={async () => {
filesToUpload?.click()
on:click={() => {
const input = document.createElement("input")
input.type = "file"
input.multiple = true
input.style.display = "none"

input.addEventListener("change", _ => {
const files = input.files
onFileSelected(input)
})

document.body.appendChild(input)
input.click()
document.body.removeChild(input)
}}>
<Icon icon={Shape.Plus} />
</Button>
<input data-cy="input=upload-files" style="display:none" multiple type="file" on:change={e => onFileSelected(e)} bind:this={filesToUpload} />

<ProgressButton appearance={Appearance.Alt} icon={Shape.ArrowsUpDown} />
{/if}
</svelte:fragment>
Expand Down

0 comments on commit 7cbb8b0

Please sign in to comment.