regression: use correct parameters on upload image on profile view (#5620)

This commit is contained in:
Gleidson Daniel Silva 2024-03-19 16:40:48 -03:00 committed by GitHub
parent afe50aed7e
commit 3fe24fac7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -138,11 +138,13 @@ const ChangeAvatarView = () => {
cropperAvoidEmptySpaceAroundImage: false, cropperAvoidEmptySpaceAroundImage: false,
cropperChooseText: I18n.t('Choose'), cropperChooseText: I18n.t('Choose'),
cropperCancelText: I18n.t('Cancel'), cropperCancelText: I18n.t('Cancel'),
includeBase64: true, includeBase64: true
useFrontCamera: isCam
}; };
try { try {
const response: Image = isCam === true ? await ImagePicker.openCamera(options) : await ImagePicker.openPicker(options); const response: Image =
isCam === true
? await ImagePicker.openCamera({ ...options, useFrontCamera: true })
: await ImagePicker.openPicker(options);
dispatchAvatar({ dispatchAvatar({
type: AvatarStateActions.CHANGE_AVATAR, type: AvatarStateActions.CHANGE_AVATAR,
payload: { url: response.path, data: `data:image/jpeg;base64,${response.data}`, service: 'upload' } payload: { url: response.path, data: `data:image/jpeg;base64,${response.data}`, service: 'upload' }