-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENG-5114 integration API /userProfiles/avatar to upload the avatar #1582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, but couple of small things
src/state/avatar/actions.js
Outdated
export const getBase64 = file => ( | ||
new Promise((resolve) => { | ||
const reader = new FileReader(); | ||
reader.readAsDataURL(file); | ||
reader.onload = () => { | ||
const base64 = reader.result.split(','); | ||
resolve(base64[1]); | ||
}; | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function already exists on line 36 in src\state\file-browser\actions.js
src/state/avatar/actions.js
Outdated
const requestObject = await createFileObject(avatar); | ||
dispatch(toggleLoading(loader)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think toggle loading should be above the await line
method: METHODS.DELETE, | ||
mockResponse: FILE_BROWSER_FILE, | ||
useAuthentication: true, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a new line at the end of the file
expect(dispatch).toHaveBeenCalledWith({ type: 'errors/add-errors', payload: { errors: TypeError('[TypeError: Failed to execute \'readAsDataURL\' on \'FileReader\': parameter 1 is not of type \'Blob\'.]') } }); | ||
expect(dispatch).toHaveBeenCalledTimes(3); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a new line at the end of the file
dispatch(addErrors(error)); | ||
dispatch(addToast(message, TOAST_ERROR)); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a new line at the end of the file
Requested publication of version |
Requested publication of version |
No description provided.