fetch rewards on page load #1754
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#1754
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fetch-rewards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#1572
Removes the
componentDidReceiveProps
hook from the<RewardsPage>
component, which was firing repeatedly.Passes in claimed rewards through the container to differentiate between "none available" and "you claimed them all".
Lets add a reward type. You don't have to replace everywhere we are using rewards right now, but it will be a good start to begin improving flow coverage.
@ -6,12 +6,15 @@ import RewardTile from 'component/rewardTile';
import Button from 'component/button';
import Page from 'component/page';
import classnames from 'classnames';
Could you add a new type in
types/reward
? Then we can improve the above two lines with actual types.@ -46,2 +30,2 @@
// }
// }
componentDidMount() {
this.props.fetchRewards();
This comment can be removed
I don't think
claimed
would be a reward right?{ 'reward name': Reward }
, not super sure how to specify that in Flow@daovist won't be able to test this in our live environment until next week's LBRY cast. Other option is to run a local internal-api server. I know @seanyesmunt has one setup...I haven't got around to trying it on Linux yet (failed on Windows in the past).
edit: I don't see a rewards list api call being kicked off when the page loads. How else would it fetch new rewards? :)
Thanks for the fix @daovist, now it fires.
There is a slight loading delay, which isn't a big deal. Are the rewards cachable similar to how we handle some of the other pages?
@tzarebczan yes, I want to rewrite the rewards page (the whole component is a mess rn) to look and function like the new channel page in terms of caching and loading but I'm thinking we should iron out the details there before using it as a model for other pages. This may include re-fetching new data while a user stays on a page. @seanyesmunt
I think this is good for now, but I agree it would be nice to add styling similar to how the channel pages work now.