client: fix drive upload
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

Using `addFile` here will add the file twice because the file is
also added through the streaming API handler.
This commit is contained in:
Johann150 2022-11-18 20:17:42 +01:00
parent 71b3b5a60c
commit 508cb00147
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -386,9 +386,7 @@ function onChangeFileInput() {
}
function upload(file: File, folderToUpload?: foundkey.entities.DriveFolder | null) {
uploadFile(file, (typeof folderToUpload === 'object') ? folderToUpload.id : null, undefined, keepOriginal).then(res => {
addFile(res, true);
});
uploadFile(file, folderToUpload?.id ?? null, undefined, keepOriginal);
}
function chooseFile(file: foundkey.entities.DriveFile) {