feat: files get added to uploader on upload

This commit is contained in:
Arman committed 2022-06-28 14:43:18 +02:00
1 parent 9f47508b44
commit 97a72d5d7e
1 file changed
+9 -1
@@ -5,6 +5,7 @@
import { createEventDispatcher } from 'svelte';
import { addNotification } from '$lib/stores/notifications';
import { page } from '$app/stores';
import { uploader } from '$lib/stores/uploader';
export let showCreate = false;
@@ -17,9 +18,16 @@
const create = async () => {
try {
await sdkForProject.storage.createFile(bucket, 'unique()', files[0], read, write);
const file = await sdkForProject.storage.createFile(
bucket,
'unique()',
files[0],
read,
write
);
files = null;
showCreate = false;
uploader.addFile(file);
dispatch('created');
} catch (error) {
addNotification({