Compare commits

...

2 Commits

Author SHA1 Message Date
Ammar Ahmed
00d3f693b0 mobile: fix crash when taking camera picture 2024-05-07 15:53:57 +05:00
Ammar Ahmed
978e63ea78 mobile: fix camera permission 2024-05-07 14:54:19 +05:00
3 changed files with 15 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ export default function AttachImage({
Attaching {response?.length} image(s):
</Paragraph>
<ScrollView horizontal>
{response?.map((item) => (
{response?.map?.((item) => (
<TouchableOpacity key={item.filename} activeOpacity={0.9}>
<Image
source={{

View File

@@ -186,7 +186,12 @@ const camera = async (options: PickerOptions) => {
maxFiles: 10,
writeTempFile: true
})
.then((response) => handleImageResponse(response, options))
.then((response) => {
handleImageResponse(
Array.isArray(response) ? response : [response],
options
);
})
.catch((e) => {
console.log("camera error: ", e);
});
@@ -211,7 +216,12 @@ const gallery = async (options: PickerOptions) => {
cropping: false,
multiple: true
})
.then((response) => handleImageResponse(response, options))
.then((response) =>
handleImageResponse(
Array.isArray(response) ? response : [response],
options
)
)
.catch((e) => {
console.log("gallery error: ", e);
});

View File

@@ -15,6 +15,8 @@
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<queries>