mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-09-26 20:41:45 +00:00
fix(web): don't run file downloads as a $derived side effect
This commit is contained in:
@@ -46,11 +46,11 @@ async function downloadFile(file: FileDTO) {
|
||||
files = note.contents
|
||||
}
|
||||
})
|
||||
let download = $derived(() => {
|
||||
function downloadAll() {
|
||||
for (const file of files) {
|
||||
downloadFile(file)
|
||||
}
|
||||
})
|
||||
}
|
||||
let links = $derived(typeof note.contents === 'string' ? note.contents.match(RE_URL) : [])
|
||||
</script>
|
||||
|
||||
@@ -92,7 +92,7 @@ async function downloadFile(file: FileDTO) {
|
||||
{/key}
|
||||
{/if}
|
||||
{/each}
|
||||
<Button onclick={download}>{$t('show.download_all')}</Button>
|
||||
<Button onclick={downloadAll}>{$t('show.download_all')}</Button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user