Skip to content

Commit d166bae

Browse files
authored
fix: remove use of deprecated currentActivity getter (#900)
* fix: remove use of deprecated currentActivity getter * Fix deprecated currentActivity getter usage Removed the use of the deprecated currentActivity getter in the picker package.
1 parent 02e06ed commit d166bae

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.changeset/healthy-pots-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-native-documents/picker": patch
3+
---
4+
5+
fix: remove use of deprecated currentActivity getter

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)