mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-09 10:50:38 +00:00
don't use blob
This commit is contained in:
@@ -8,19 +8,20 @@
|
||||
export let label: string = ''
|
||||
export let files: FileDTO[] = []
|
||||
|
||||
function fileToDTO(file: File): FileDTO {
|
||||
async function fileToDTO(file: File): Promise<FileDTO> {
|
||||
return {
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
type: file.type,
|
||||
contents: file,
|
||||
contents: new Uint8Array(await file.arrayBuffer()),
|
||||
}
|
||||
}
|
||||
|
||||
async function onInput(e: Event) {
|
||||
const input = e.target as HTMLInputElement
|
||||
if (input?.files?.length) {
|
||||
files = [...files, ...Array.from(input.files).map(fileToDTO)]
|
||||
const toAdd = await Promise.all(Array.from(input.files).map(fileToDTO))
|
||||
files = [...files, ...toAdd]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import DOMPurify from 'dompurify'
|
||||
import * as DOMPurify from 'dompurify'
|
||||
import { saveAs } from 'file-saver'
|
||||
import prettyBytes from 'pretty-bytes'
|
||||
import { t } from 'svelte-intl-precompile'
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import copyToClipboard from 'copy-to-clipboard'
|
||||
import * as copyToClipboard from 'copy-to-clipboard'
|
||||
import { t } from 'svelte-intl-precompile'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user