@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.
@@ -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 DocumentPicker.getDocumentAsync({
790
+ const result = await picker.getDocumentAsync({
776
791
  type: '*/*',
777
792
  multiple: true,
778
793
  copyToCacheDirectory: true,