@oxyhq/services 5.16.8 → 5.16.10
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.
- package/lib/commonjs/ui/context/OxyContext.js +14 -7
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +2 -4
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +17 -2
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +14 -7
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +2 -4
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +16 -2
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/context/OxyContext.tsx +21 -19
- package/src/ui/screens/AccountOverviewScreen.tsx +1 -1
- package/src/ui/screens/FileManagementScreen.tsx +17 -2
|
@@ -14,8 +14,20 @@ import {
|
|
|
14
14
|
Alert,
|
|
15
15
|
} from 'react-native';
|
|
16
16
|
import { Image as ExpoImage } from 'expo-image';
|
|
17
|
-
import * as DocumentPicker from 'expo-document-picker';
|
|
18
17
|
import type { FileManagementScreenProps } from '../types/fileManagement';
|
|
18
|
+
|
|
19
|
+
// Lazy load expo-document-picker (optional dependency)
|
|
20
|
+
// This allows the screen to work even if expo-document-picker is not installed
|
|
21
|
+
let DocumentPicker: typeof import('expo-document-picker') | null = null;
|
|
22
|
+
const loadDocumentPicker = async () => {
|
|
23
|
+
if (DocumentPicker) return DocumentPicker;
|
|
24
|
+
try {
|
|
25
|
+
DocumentPicker = await import('expo-document-picker');
|
|
26
|
+
return DocumentPicker;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw new Error('expo-document-picker is not installed. Please install it: npx expo install expo-document-picker');
|
|
29
|
+
}
|
|
30
|
+
};
|
|
19
31
|
import { toast } from '../../lib/sonner';
|
|
20
32
|
import { Ionicons } from '@expo/vector-icons';
|
|
21
33
|
// @ts-ignore - MaterialCommunityIcons is available at runtime
|
|
@@ -770,9 +782,12 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
770
782
|
try {
|
|
771
783
|
setIsPickingDocument(true);
|
|
772
784
|
|
|
785
|
+
// Lazy load expo-document-picker
|
|
786
|
+
const picker = await loadDocumentPicker();
|
|
787
|
+
|
|
773
788
|
// Use expo-document-picker (works on all platforms including web)
|
|
774
789
|
// On web, it uses the native file input and provides File objects directly
|
|
775
|
-
const result = await
|
|
790
|
+
const result = await picker.getDocumentAsync({
|
|
776
791
|
type: '*/*',
|
|
777
792
|
multiple: true,
|
|
778
793
|
copyToCacheDirectory: true,
|