Skip to content

Commit

Permalink
shutdowninternal should not return error
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Nov 28, 2024
1 parent 32985b5 commit a429aab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 1 addition & 2 deletions android/src/main/java/land/fx/fula/FulaModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,7 @@ private void shutdownInternal() throws Exception {

}
} catch (Exception e) {
Log.d("ReactNative", "shutdownInternal"+ e.getMessage());
throw (e);
Log.d("ReactNative", "shutdownInternal error: "+ e.getMessage());
}
}

Expand Down
14 changes: 10 additions & 4 deletions ios/Fula.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1220,12 +1220,18 @@ class FulaModule: NSObject {

}

func shutdownInternal() throws {
func shutdownInternal() {
NSLog("ReactNative shutdownInternal")
if(self.fula != nil) {
if self.fula != nil {
NSLog("ReactNative shutdownInternal fula is not null")
try self.fula?.shutdown()
NSLog("ReactNative shutdownInternal fula.shutdown called")
do {
try self.fula?.shutdown()
NSLog("ReactNative shutdownInternal fula.shutdown called")
} catch {
// Handle specific errors if needed or log them
NSLog("ReactNative shutdownInternal error: \(error.localizedDescription)")
}
// Ensure resources are cleaned up regardless of errors
self.fula = nil
self.client = nil
self.wnfs = nil
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@functionland/react-native-fula",
"version": "1.54.29",
"version": "1.54.30",
"description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit a429aab

Please sign in to comment.