From efc20d3bb2abef541d7239475bd6da4525212840 Mon Sep 17 00:00:00 2001 From: Vali98 Date: Sat, 21 Sep 2024 18:41:48 +0800 Subject: [PATCH] feat: allow multi selection when importing character from file --- app/constants/Characters.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/constants/Characters.ts b/app/constants/Characters.ts index 8f81edd..0c7ef70 100644 --- a/app/constants/Characters.ts +++ b/app/constants/Characters.ts @@ -496,9 +496,14 @@ export namespace Characters { return DocumentPicker.getDocumentAsync({ copyToCacheDirectory: true, type: 'image/*', + multiple: true, }).then((result) => { if (result.canceled) return - return createCharacterFromImage(result.assets[0].uri) + result.assets.map(async (item) => { + await createCharacterFromImage(item.uri).catch((e) => + Logger.log(`Failed to create card from '${item.name}': ${e}`) + ) + }) }) }