Skip to content

Commit

Permalink
Merge pull request #96 from OP-Engineering/osp/fixes-for-moveAssetsDa…
Browse files Browse the repository at this point in the history
…tabase

Minor fixes for moveAssetsDatabase
  • Loading branch information
ospfranco authored May 13, 2024
2 parents c6aa5f0 + b07c01d commit ca4cb31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions android/src/main/java/com/op/sqlite/OPSQLiteModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> => {
return NativeModules.OPSQLite.moveAssetsDatabase(args);
};

Expand Down

0 comments on commit ca4cb31

Please sign in to comment.