@react-native-documents/picker 11.0.1 → 11.0.3
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.
|
@@ -96,18 +96,14 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
|
|
|
96
96
|
val intent = IntentFactory.getPickIntent(options)
|
|
97
97
|
currentActivity.startActivityForResult(intent, PICK_FILES_REQUEST_CODE)
|
|
98
98
|
} catch (e: ActivityNotFoundException) {
|
|
99
|
-
|
|
99
|
+
promiseWrapper.reject(UNABLE_TO_OPEN_FILE_TYPE, e)
|
|
100
100
|
} catch (e: Exception) {
|
|
101
|
-
|
|
101
|
+
promiseWrapper.reject(E_OTHER_PRESENTING_ERROR, e)
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
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)
|
|
111
107
|
if (!promiseWrapper.trySetPromiseRejectingIncoming(promise, "saveDocuments")) {
|
|
112
108
|
return
|
|
113
109
|
}
|
|
@@ -134,9 +130,9 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
|
|
|
134
130
|
}
|
|
135
131
|
currentActivity.startActivityForResult(intent, SAVE_DOC_REQUEST_CODE)
|
|
136
132
|
} catch (e: ActivityNotFoundException) {
|
|
137
|
-
|
|
133
|
+
promiseWrapper.reject(UNABLE_TO_OPEN_FILE_TYPE, e)
|
|
138
134
|
} catch (e: Exception) {
|
|
139
|
-
|
|
135
|
+
promiseWrapper.reject(E_OTHER_PRESENTING_ERROR, e)
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
138
|
|
|
@@ -163,9 +159,9 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
|
|
|
163
159
|
// TODO option for extra task on stack?
|
|
164
160
|
currentActivity.startActivityForResult(intent, PICK_DIR_REQUEST_CODE)
|
|
165
161
|
} catch (e: ActivityNotFoundException) {
|
|
166
|
-
|
|
162
|
+
promiseWrapper.reject(UNABLE_TO_OPEN_FILE_TYPE, e)
|
|
167
163
|
} catch (e: Exception) {
|
|
168
|
-
|
|
164
|
+
promiseWrapper.reject(E_OTHER_PRESENTING_ERROR, e)
|
|
169
165
|
}
|
|
170
166
|
}
|
|
171
167
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-documents/picker",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "A react native interface to access documents from dropbox, google drive, iCloud...",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|