regression: use correct parameters on upload image on profile view

This commit is contained in:
GleidsonDaniel 2024-03-19 14:12:22 -03:00
parent afe50aed7e
commit a5b4122083
1 changed files with 5 additions and 3 deletions

View File

@ -138,11 +138,13 @@ const ChangeAvatarView = () => {
cropperAvoidEmptySpaceAroundImage: false,
cropperChooseText: I18n.t('Choose'),
cropperCancelText: I18n.t('Cancel'),
includeBase64: true,
useFrontCamera: isCam
includeBase64: true
};
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({
type: AvatarStateActions.CHANGE_AVATAR,
payload: { url: response.path, data: `data:image/jpeg;base64,${response.data}`, service: 'upload' }