@react-native-documents/picker 10.1.5 → 10.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -83,12 +83,8 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
|
|
|
83
83
|
|
|
84
84
|
@ReactMethod
|
|
85
85
|
override fun pick(opts: ReadableMap, promise: Promise) {
|
|
86
|
-
val currentActivity = currentActivity
|
|
86
|
+
val currentActivity = reactApplicationContext.currentActivity ?: return rejectWithNullActivity(promise)
|
|
87
87
|
|
|
88
|
-
if (currentActivity == null) {
|
|
89
|
-
rejectWithNullActivity(promise)
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
88
|
if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "pick")) {
|
|
93
89
|
return
|
|
94
90
|
}
|
|
@@ -145,11 +141,8 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
|
|
|
145
141
|
|
|
146
142
|
@ReactMethod
|
|
147
143
|
override fun pickDirectory(opts: ReadableMap, promise: Promise) {
|
|
148
|
-
val currentActivity = currentActivity
|
|
149
|
-
|
|
150
|
-
rejectWithNullActivity(promise)
|
|
151
|
-
return
|
|
152
|
-
}
|
|
144
|
+
val currentActivity = reactApplicationContext.currentActivity ?: return rejectWithNullActivity(promise)
|
|
145
|
+
|
|
153
146
|
if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "pickDirectory")) {
|
|
154
147
|
return
|
|
155
148
|
}
|
package/package.json
CHANGED