From ef9267b4119facf0101902399e20ee2b8888ffe0 Mon Sep 17 00:00:00 2001 From: CD-Z Date: Sat, 10 Jun 2023 15:25:18 +0200 Subject: [PATCH] release --- package.json | 4 ++-- src/main.ts | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index ccc7179..1389de2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cd-z/react-native-epub-creator", - "version": "1.3.3", + "version": "2.0.0", "description": "This react-native library create epub file for android and IOS", "main": "index.ts", "keywords": [ @@ -45,7 +45,7 @@ "lib/" ], "dependencies": { - "@cd-z/epub-constructor": "^1.2.0", + "@cd-z/epub-constructor": "^2.0.0", "expo-file-system": "^15.2.2", "react-native-saf-x": "^2.2.1", "react-native-zip-archive": "^6.0.3" diff --git a/src/main.ts b/src/main.ts index c814fb7..8643156 100644 --- a/src/main.ts +++ b/src/main.ts @@ -184,12 +184,15 @@ export default class EpubBuilder { } private async pickFolder() { - const folder = await openDocumentTree(true); - if (folder) { - this.outputPath = folder.uri; - return; - } - throw new Error("No permissions to access destination folder granted."); + return new Promise(async (resolve, reject) => { + const folder = await openDocumentTree(true); + if (folder) { + this.outputPath = folder.uri; + resolve(); + } + + reject("No permissions to access destination folder granted."); + }); } private async createTempFolder() {