Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Provide feedback when user refreshes account #451
I noticed that when you click the refresh button no progress and no feedback is provided.
I added an animation to the refresh button when a refresh is being done (which most often you can't even see because it's too fast - but you never know.. ;) ) and added feedback (toast) when the refresh is done.
The whole thing looks like this (note: I added a manually timeout of 3000ms for demo purposes):
I also disabled "button-spamming" which basically means when a request is already executing clicking the button again will not do another request.
I have 3 questions:
- I like it and the animation is a good idea.
- Probably is enough.
toastServicetranslates the texts.
- When the user has the "Refresh accounts automatically" setting on, showing the toast every n seconds is very annoying. When that option is disabled and the user clicks on the refresh button is the expected behaviour.
- Use the animation and the same behaviour on the dashboard refresh button too.
=> fair enough, did not see that => fixed
=> done, note that I had to fix a bug which always occurs for me (and prevented me to even test my refresh logic), I did the easiest possible fix, not sure if there need to be done more (however maybe not in this PR since it's not related to it and think my fix is also correct)
After I added the animation and logic to the second button I realized that there was a lot of code and logic duplication, so I decided to refactor it. By doing that I also made the logic way more generic - I'm quite happy with the result :) I hope you are too :D
One last thing: