Skip to content

Fix issue #287 #409

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

Merged
merged 2 commits into from
Sep 1, 2017
Merged

Fix issue #287 #409

merged 2 commits into from
Sep 1, 2017

Conversation

elfman
Copy link
Contributor

@elfman elfman commented Aug 29, 2017

Fix issue #287

@birdofpreyru
Copy link
Collaborator

@elfman Nope, we can do better. The problem with this default avatar in the tooltip is that the logic to show it is really goofy: it always tries to load the photo, and if it fails due to 404 error, then it updates the URL to the default avatar in the error handler.

  1. There should be no errors: if winner object has no photo URL - we just use the default avatar immediately; if he has absolute photo URL - we use it; if the URL is relative (like /i/m/some-avatar.jpg), it should be prepended with the correct domain (now, when I am running locally, it goes to local.topcoder.com/i/m/some-avatar.jpg, which is wrong, thus fails).
  2. We have a standard component for rendering avatars: https://github.com/topcoder-platform/community-app/blob/develop/src/shared/components/Avatar/index.jsx which basically takes care about styling. For the usecase in the listing, I guess, just the default theme of that component is the same, so we should reuse that.

@elfman
Copy link
Contributor Author

elfman commented Aug 30, 2017

@birdofpreyru Updated as your suggestion, except the theme of avatar. The default avatar theme is so small, I change it bigger

@birdofpreyru
Copy link
Collaborator

@elfman Well, but do we really need the onError handler? I would expect we don't, cause if we compose avatar URLs in the correct way (adding the right base domain from configuration) then all URLs gonna be just correct.

@birdofpreyru
Copy link
Collaborator

So, no need to modify avatar component then

@elfman
Copy link
Contributor Author

elfman commented Aug 30, 2017

@birdofpreyru I have composed the URLs in line 36 of UserAvatarTooltip/index.js. Adding handleError is just wanna to show a default avatar when some network error happen, in case there would be empty area.

@birdofpreyru
Copy link
Collaborator

@elfman Hmm... I prefer to remove error handlers. If the page fails due to network error, broken avatar images is the least of the problems, as most probably it will also break everything else. So, no need for such complication of the code.

@elfman
Copy link
Contributor Author

elfman commented Aug 31, 2017

@birdofpreyru Updated, please check.

@elfman
Copy link
Contributor Author

elfman commented Aug 31, 2017

@birdofpreyru Currently on origin/develop, ChallengeList does not work when there is no query string, this is not introduced by me

@birdofpreyru
Copy link
Collaborator

@elfman Btw, have you seen my last post in the challenge forum? I don't know what is your TC nickname to be able to pay for the Bug Hunt part of the challenge.

@elfman
Copy link
Contributor Author

elfman commented Aug 31, 2017

@birdofpreyru sorry, my TC nickname is windyluo

@birdofpreyru birdofpreyru merged commit 741030c into topcoder-platform:develop Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants