Skip to content

Commit 9e10304

Browse files
authored
Merge pull request #91 from ngocle2497/fix/expo_reload
fix: expo reload with dev client
2 parents aee056f + 5b42f09 commit 9e10304

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

ios/Keys.mm

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#import "YeetJSIUtils.h"
77
#import <React/RCTBridge+Private.h>
88

9-
//#import "crypto.cpp"
109
#import "crypto.h"
1110
#import "GeneratedDotEnv.m"
1211
#import "privateKey.m"
@@ -38,20 +37,14 @@ + (BOOL)requiresMainQueueSetup {
3837
if (jsiRuntime == nil) {
3938
return @false;
4039
}
40+
41+
auto& runtime = *jsiRuntime;
4142

42-
// example::install(*(facebook::jsi::Runtime *)jsiRuntime);
43-
install(*(facebook::jsi::Runtime *)jsiRuntime, self);
44-
45-
46-
return @true;
47-
}
48-
49-
static void install(jsi::Runtime &jsiRuntime, Keys *_Keys) {
50-
auto secureFor = Function::createFromHostFunction(jsiRuntime,
51-
PropNameID::forAscii(jsiRuntime,
43+
auto secureFor = Function::createFromHostFunction(runtime,
44+
PropNameID::forAscii(runtime,
5245
"secureFor"),
53-
0,
54-
[_Keys](Runtime &runtime,
46+
1,
47+
[](Runtime &runtime,
5548
const Value &thisValue,
5649
const Value *arguments,
5750
size_t count) -> Value {
@@ -60,14 +53,14 @@ static void install(jsi::Runtime &jsiRuntime, Keys *_Keys) {
6053
return Value(runtime, convertNSStringToJSIString(runtime, value));
6154
});
6255

63-
jsiRuntime.global().setProperty(jsiRuntime, "secureFor", move(secureFor));
56+
runtime.global().setProperty(runtime, "secureFor", std::move(secureFor));
6457

6558

66-
auto publicKeys = Function::createFromHostFunction(jsiRuntime,
67-
PropNameID::forAscii(jsiRuntime,
59+
auto publicKeys = Function::createFromHostFunction(runtime,
60+
PropNameID::forAscii(runtime,
6861
"publicKeys"),
6962
0,
70-
[_Keys](Runtime &runtime,
63+
[](Runtime &runtime,
7164
const Value &thisValue,
7265
const Value *arguments,
7366
size_t count) -> Value {
@@ -76,12 +69,15 @@ static void install(jsi::Runtime &jsiRuntime, Keys *_Keys) {
7669

7770
});
7871

79-
jsiRuntime.global().setProperty(jsiRuntime, "publicKeys", move(publicKeys));
80-
72+
runtime.global().setProperty(runtime, "publicKeys", std::move(publicKeys));
8173

8274

75+
76+
77+
return @true;
8378
}
8479

80+
8581
+ (NSString *)secureFor: (NSString *)key {
8682
@try {
8783
NSDictionary *privatesKeyEnv = PRIVATE_KEY;

0 commit comments

Comments
 (0)