fetch rewards on page load #1754

Merged
daovist merged 3 commits from fetch-rewards into master 2018-07-15 02:10:22 +02:00
daovist commented 2018-07-11 15:48:16 +02:00 (Migrated from github.com)

#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".

#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".
neb-b (Migrated from github.com) requested changes 2018-07-11 19:34:40 +02:00
neb-b (Migrated from github.com) left a comment

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.

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';
neb-b (Migrated from github.com) commented 2018-07-11 19:33:55 +02:00

Could you add a new type in types/reward? Then we can improve the above two lines with actual types.

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();
neb-b (Migrated from github.com) commented 2018-07-11 19:33:06 +02:00

This comment can be removed

This comment can be removed
neb-b (Migrated from github.com) reviewed 2018-07-11 22:56:04 +02:00
neb-b (Migrated from github.com) commented 2018-07-11 22:56:04 +02:00

I don't think claimed would be a reward right? { 'reward name': Reward }, not super sure how to specify that in Flow

I don't think `claimed` would be a reward right? ` { 'reward name': Reward } `, not super sure how to specify that in Flow
tzarebczan commented 2018-07-12 16:59:57 +02:00 (Migrated from github.com)

@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? :)

@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? :)
tzarebczan commented 2018-07-13 15:36:15 +02:00 (Migrated from github.com)

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?

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?
daovist commented 2018-07-13 15:53:56 +02:00 (Migrated from github.com)

@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

@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
neb-b commented 2018-07-15 02:10:00 +02:00 (Migrated from github.com)

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.

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.
neb-b (Migrated from github.com) approved these changes 2018-07-15 02:10:16 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#1754
No description provided.