From b07c01d1872c20830b4f5b69b547112c3b3b811f Mon Sep 17 00:00:00 2001 From: ospfranco Date: Mon, 13 May 2024 07:08:20 +0200 Subject: [PATCH] Minor fixes --- android/src/main/java/com/op/sqlite/OPSQLiteModule.kt | 5 ++--- src/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt b/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt index 5f36b625..6179cfc7 100644 --- a/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt +++ b/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt @@ -59,10 +59,7 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB val assetsManager = context.assets try { - // Open the input stream for the asset file - val inputStream: InputStream = assetsManager.open("$path/$filename") - // Create the output file in the documents directory val databasesFolder = context.getDatabasePath("defaultDatabase") .absolutePath @@ -79,6 +76,8 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB } } + val inputStream: InputStream = assetsManager.open("$path/$filename") + // Open the output stream for the output file val outputStream: OutputStream = FileOutputStream(outputFile) diff --git a/src/index.ts b/src/index.ts index 055bdc1b..eac68a6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -489,11 +489,11 @@ export const open = (options: { }; }; -export const moveAssetsDatabase = (args: { +export const moveAssetsDatabase = async (args: { filename: string; path?: string; overwrite?: boolean; -}): boolean => { +}): Promise => { return NativeModules.OPSQLite.moveAssetsDatabase(args); };