Use network APIClient reactContext if already set (#7426)

This commit is contained in:
Elias Nahum 2023-06-27 10:30:31 -04:00 committed by GitHub
parent 275f40f8d9
commit 72f7c639c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ public class Network {
private static final Promise emptyPromise = new ResolvePromise();
public static void init(Context context) {
final ReactApplicationContext reactContext = new ReactApplicationContext(context);
final ReactApplicationContext reactContext = (APIClientModule.context == null) ? new ReactApplicationContext(context) : APIClientModule.context;
clientModule = new APIClientModule(reactContext);
createClientOptions();
}