Skip to content

Commit

Permalink
fix: remove useless assignment to local variable emailCopy (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRuf authored and juanpicado committed Jan 14, 2019
1 parent ab56d75 commit 13b8347
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ export const GRAVATAR_DEFAULT =
* Generate gravatar url from email address
*/
export function generateGravatarUrl(email: string = ''): string {
let emailCopy = email;
if (_.isString(email) && _.size(email) > 0) {
emailCopy = email.trim().toLocaleLowerCase();
const emailMD5 = stringToMD5(emailCopy);
email = email.trim().toLocaleLowerCase();
const emailMD5 = stringToMD5(email);
return `https://www.gravatar.com/avatar/${emailMD5}`;
}
return GRAVATAR_DEFAULT;
Expand Down

0 comments on commit 13b8347

Please sign in to comment.