feat(webui): select all uploaded files when done
parent
1d1476c7b8
commit
3196294033
|
@ -16,6 +16,7 @@
|
||||||
import api from '$lib/api';
|
import api from '$lib/api';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { i18n } from '$lib/i18n';
|
import { i18n } from '$lib/i18n';
|
||||||
|
import { selected } from '$lib/components/EntitySelect.svelte';
|
||||||
|
|
||||||
let files: File[] = [];
|
let files: File[] = [];
|
||||||
let URLs: string[] = [];
|
let URLs: string[] = [];
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
uploading = true;
|
uploading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const addresses = [];
|
const addresses: string[] = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const address = await api.putBlob(file, {
|
const address = await api.putBlob(file, {
|
||||||
onProgress: (p) => {
|
onProgress: (p) => {
|
||||||
|
@ -51,7 +52,12 @@
|
||||||
addresses.push(address);
|
addresses.push(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
goto(`/browse/${addresses.join(',')}`);
|
if (addresses.length == 1) {
|
||||||
|
goto(`/browse/${addresses[0]}`);
|
||||||
|
} else {
|
||||||
|
$selected = addresses;
|
||||||
|
goto(`/browse/selected`);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert(error);
|
alert(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue