@widergy/mobile-ui 0.39.1 → 0.39.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.39.2](https://github.com/widergy/mobile-ui/compare/v0.39.1...v0.39.2) (2023-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* process tracking by logs when capturing photos ([8150040](https://github.com/widergy/mobile-ui/commit/8150040a17142f042c079668c3e4b96d0a331d5c))
|
|
7
|
+
|
|
1
8
|
## [0.39.1](https://github.com/widergy/mobile-ui/compare/v0.39.0...v0.39.1) (2023-08-14)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -20,7 +20,8 @@ const Capture = ({
|
|
|
20
20
|
sourceCameraImage,
|
|
21
21
|
sourceEditImage,
|
|
22
22
|
messageErrorPermissionCamera,
|
|
23
|
-
selectionMessage
|
|
23
|
+
selectionMessage,
|
|
24
|
+
onError
|
|
24
25
|
}) => {
|
|
25
26
|
const isOnlyOnePicture = maxImages === 1 && images.length === 1;
|
|
26
27
|
const isItPossibleToAddAnotherPhoto = isOnlyOnePicture ? false : images.length <= maxImages;
|
|
@@ -47,6 +48,7 @@ const Capture = ({
|
|
|
47
48
|
sourceEditImage={sourceEditImage}
|
|
48
49
|
messageErrorPermissionCamera={messageErrorPermissionCamera}
|
|
49
50
|
selectionMessage={selectionMessage}
|
|
51
|
+
onError={onError}
|
|
50
52
|
/>
|
|
51
53
|
{!!helpText && <Label style={styles.paddingText}>{helpText}</Label>}
|
|
52
54
|
</Fragment>
|
|
@@ -61,17 +61,21 @@ const PhotoAlbum = ({
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const openCamera = async () => {
|
|
64
|
-
|
|
64
|
+
try {
|
|
65
|
+
await requestPermission();
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const response = await launchCamera({});
|
|
68
|
+
const { didCancel, errorCode, errorMessage, assets } = response;
|
|
69
|
+
if (didCancel || errorCode) {
|
|
70
|
+
if (errorCode) {
|
|
71
|
+
onUnknownCameraError(`[${errorCode}] : ${errorMessage}`);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
const { uri } = assets[0];
|
|
75
|
+
onPressAddAnotherPhoto({ newImage: { uri }, numberOfPhotosInTheAlbumHasExceeded });
|
|
71
76
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
onPressAddAnotherPhoto({ newImage: { uri }, numberOfPhotosInTheAlbumHasExceeded });
|
|
77
|
+
} catch (error) {
|
|
78
|
+
throw error;
|
|
75
79
|
}
|
|
76
80
|
};
|
|
77
81
|
|
package/package.json
CHANGED