Skip to content

Commit 2973316

Browse files
committed
fixed JSI with hermes on RN0.70
1 parent 600113a commit 2973316

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

cpp/react-native-fast-openpgp.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,14 @@ namespace fastOpenPGP {
131131
auto rejectFunction = arguments[1].getObject(runtime).asFunction(
132132
runtime);
133133

134-
auto resolveFunctionFuture = std::make_shared<jsi::Function>(
135-
std::move(resolveFunction));
136-
auto rejectFunctionFuture = std::make_shared<jsi::Function>(
137-
std::move(rejectFunction));
138-
139-
std::async(std::launch::async,
140-
[rejectFunctionFuture, resolveFunctionFuture, &runtime, nameFuture, payloadFuture]() {
141-
auto response = call(runtime, *nameFuture,
142-
*payloadFuture);
143-
144-
if (response.isString()) {
145-
rejectFunctionFuture->call(runtime, response);
146-
return;
147-
}
148-
resolveFunctionFuture->call(runtime, response);
149-
}).get();
134+
auto response = call(runtime, *nameFuture, *payloadFuture);
135+
136+
if (response.isString()) {
137+
rejectFunction.call(runtime, response);
138+
} else {
139+
resolveFunction.call(runtime, response);
140+
}
141+
150142
return jsi::Value(0);
151143
}
152144
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-fast-openpgp",
3-
"version": "2.4.4",
3+
"version": "2.4.5",
44
"description": "library for use openPGP",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)