From 84da9d4cd485762909835a80081fec14070fc999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=91=E3=81=A3=E3=81=A1?= Date: Sun, 13 Mar 2022 14:37:55 +0900 Subject: [PATCH] fix: wip --- packages/client/src/scripts/select-file-enc.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/client/src/scripts/select-file-enc.ts b/packages/client/src/scripts/select-file-enc.ts index d5ea970a6..1b23e0717 100644 --- a/packages/client/src/scripts/select-file-enc.ts +++ b/packages/client/src/scripts/select-file-enc.ts @@ -31,10 +31,10 @@ function select(src: any, label: string | null, multiple: boolean): Promise { os.alert({ type: 'error', text: e }) }); } - Array.from(input.files).map(file => { + const promises = Array.from(input.files).map(file => { if (file.type.indexOf('video') !== -1) { console.log('convert video'); os.toast('Try convert to mp4'); @@ -118,6 +119,14 @@ function select(src: any, label: string | null, multiple: boolean): Promise { + res(multiple ? driveFiles : driveFiles[0]); + }).catch(e => { + os.alert({ + type: 'error', + text: e + }); + }); // 一応廃棄