Skip to content

Commit d7a72ec

Browse files
committed
fix: remove use of deprecated currentActivity getter
1 parent 02e06ed commit d7a72ec

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

packages/document-picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
103103
}
104104

105105
override fun saveDocument(options: ReadableMap, promise: Promise) {
106-
val currentActivity = currentActivity
107-
if (currentActivity == null) {
108-
rejectWithNullActivity(promise)
109-
return
110-
}
106+
val currentActivity = reactApplicationContext.currentActivity ?: return rejectWithNullActivity(promise)
111107
if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "saveDocuments")) {
112108
return
113109
}

0 commit comments

Comments
 (0)