fix leftovers after [#4051] PR (app crashes on iOS)
This commit is contained in:
parent
fc72443754
commit
90a508b64f
|
@ -85,16 +85,11 @@ RCT_EXPORT_METHOD(parseJail:(NSString *)chatId
|
||||||
NSLog(@"ParseJail() method called");
|
NSLog(@"ParseJail() method called");
|
||||||
#endif
|
#endif
|
||||||
NSString *stringResult;
|
NSString *stringResult;
|
||||||
if([Status JSCEnabled]){
|
|
||||||
if(_jail == nil) {
|
if(_jail == nil) {
|
||||||
_jail = [Jail new];
|
_jail = [Jail new];
|
||||||
}
|
}
|
||||||
NSDictionary *result = [_jail parseJail:chatId withCode:js];
|
NSDictionary *result = [_jail parseJail:chatId withCode:js];
|
||||||
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
|
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
|
||||||
} else {
|
|
||||||
char * result = Parse((char *) [chatId UTF8String], (char *) [js UTF8String]);
|
|
||||||
stringResult = [NSString stringWithUTF8String: result];
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(@[stringResult]);
|
callback(@[stringResult]);
|
||||||
}
|
}
|
||||||
|
@ -110,16 +105,11 @@ RCT_EXPORT_METHOD(callJail:(NSString *)chatId
|
||||||
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
|
||||||
NSString *stringResult;
|
NSString *stringResult;
|
||||||
if([Status JSCEnabled]){
|
|
||||||
if(_jail == nil) {
|
if(_jail == nil) {
|
||||||
_jail = [Jail new];
|
_jail = [Jail new];
|
||||||
}
|
}
|
||||||
NSDictionary *result = [_jail call:chatId path:path params:params];
|
NSDictionary *result = [_jail call:chatId path:path params:params];
|
||||||
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
|
stringResult = [result bv_jsonStringWithPrettyPrint:NO];
|
||||||
} else {
|
|
||||||
char * result = Call((char *) [chatId UTF8String], (char *) [path UTF8String], (char *) [params UTF8String]);
|
|
||||||
stringResult = [NSString stringWithUTF8String: result];
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch_async( dispatch_get_main_queue(), ^{
|
dispatch_async( dispatch_get_main_queue(), ^{
|
||||||
callback(@[stringResult]);
|
callback(@[stringResult]);
|
||||||
|
|
Loading…
Reference in New Issue