Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import java.lang.Exception
class TransactReactNativeModule(reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext) {

private val _reactContext = reactContext

override fun getName(): String {
return NAME
}
Expand Down Expand Up @@ -66,8 +64,8 @@ class TransactReactNativeModule(reactContext: ReactApplicationContext) :

@ReactMethod
fun presentTransact(token: String, environment: ReadableMap, promise: Promise) {
val context = currentActivity as Context
val emitter = _reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
val context = reactApplicationContext.currentActivity as Context
val emitter = reactApplicationContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
val environmentURL = parseEnvironment(environment)
val config = Config(token = token, environment = "CUSTOM", environmentURL = environmentURL)

Expand Down Expand Up @@ -104,8 +102,8 @@ class TransactReactNativeModule(reactContext: ReactApplicationContext) :

@ReactMethod
fun presentAction(id: String, environment: ReadableMap, promise: Promise) {
val context = currentActivity as Context
val emitter = _reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
val context = reactApplicationContext.currentActivity as Context
val emitter = reactApplicationContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
val environmentURL = parseEnvironment(environment)

try {
Expand Down