motorinc-gallery-picker-pro 1.0.8 → 1.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motorinc-gallery-picker-pro",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A comprehensive React Native media gallery picker with smooth animations, multi-select, single-select, crop functionality, and native iOS/Android support",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -35,6 +35,7 @@
35
35
  "react-native-view-shot": ">=4.0.0"
36
36
  },
37
37
  "dependencies": {
38
+ "motorinc-gallery-picker-pro": "^1.0.8",
38
39
  "motorinc-global-components": "^3.9.5",
39
40
  "react-native-worklets": "^0.4.1"
40
41
  },
@@ -651,7 +651,11 @@ const MainPhotoGallery = React.forwardRef<MainPhotoGalleryRef, props>(
651
651
  });
652
652
 
653
653
  if (reset) {
654
- setAssets(result.assets || []);
654
+ // When resetting, preserve picker assets by prepending them
655
+ const currentPickerAssets = assets.filter(asset =>
656
+ pickerAssetIds.has(asset.id)
657
+ );
658
+ setAssets([...currentPickerAssets, ...(result.assets || [])]);
655
659
  } else {
656
660
  setAssets(prev => [...prev, ...(result.assets || [])]);
657
661
  }
@@ -840,8 +844,7 @@ const MainPhotoGallery = React.forwardRef<MainPhotoGalleryRef, props>(
840
844
  console.log('📊 Total count:', totalCount);
841
845
 
842
846
  if (Platform.OS === 'ios') {
843
- // Check current permission status first
844
-
847
+ // iOS: Use the limited photo library picker
845
848
  const currentStatus =
846
849
  await ImagePickerModule.getPhotoLibraryPermissionStatus();
847
850
 
@@ -861,21 +864,21 @@ const MainPhotoGallery = React.forwardRef<MainPhotoGalleryRef, props>(
861
864
  const res = await ImagePickerModule.openPhotoLibraryLimitedPicker();
862
865
 
863
866
  console.log('✅ Limited photo picker opened successfully:', res);
867
+
868
+ // Refresh gallery after potential selection changes
869
+ setTimeout(() => {
870
+ console.log('� Refreshing gallery after photo selection changes');
871
+ handleRefresh();
872
+ }, 2000);
864
873
  } else {
865
- // Use the universal managePhotoSelection method available on both platforms
866
- console.log('🚀 Attempting to call managePhotoSelection...');
867
- const res = await ImagePickerModule.managePhotoSelection();
868
- console.log(
869
- '✅ Photo selection management opened successfully:',
870
- res,
871
- );
874
+ // Android: Use the multi-select image picker instead
875
+ console.log('🚀 Opening Android photo picker...');
876
+ await handleOpenImagePicker();
877
+ console.log('✅ Android photo picker flow completed');
878
+ // Note: handleOpenImagePicker already handles the selection and callback
879
+ // No need to refresh gallery as selected images are passed to onSelectedAssetsChange
880
+ return;
872
881
  }
873
-
874
- // Refresh gallery after potential selection changes
875
- setTimeout(() => {
876
- console.log('🔄 Refreshing gallery after photo selection changes');
877
- handleRefresh();
878
- }, 2000);
879
882
  } catch (error) {
880
883
  console.error('❌ Error managing photo selection:', error);
881
884