Skip to content
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

Discussion Count Redux #770

Closed
wants to merge 2 commits into from
Closed

Discussion Count Redux #770

wants to merge 2 commits into from

Conversation

joshslee
Copy link
Contributor

Features

Resolves 2 / 3 of #759

  1. Update count when inline-comments are made or removed (client-side)
  • move hook and state to existing reducer
  1. Create a "root component" for Discussions that will fetch & propagate the redux data rather than having the fetch being done at the page-level component

@joshslee joshslee added bug Something isn't working enhancement New feature or request labels Apr 30, 2021
@joshslee joshslee requested a review from lightninglu10 April 30, 2021 14:54
@joshslee joshslee self-assigned this Apr 30, 2021
Copy link
Contributor

@calvinhlee23 calvinhlee23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I had some questions regarding the usage of a component

Comment on lines +96 to 102
useEffect(() => {
fetchDiscussionThreads(false, true);
}, []);

useEffect(() => {
fetchDiscussionThreads(false, true);
}, [filter, showTwitterComments]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double check logic here. Seems unnecessary to double fetch like this

@@ -380,7 +386,7 @@ const DiscussionTab = (props) => {
) : showTwitterComments ? (
calculateCount()
) : (
props.calculatedCount
<DiscussionCount />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, not sure if this needs to be a component. If we already have an access to the count via redux, we could probably just display it here.
If this was necessary, could you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I made it like this because I thought that was being asked: "Create a "root component" for Discussions that will fetch & propagate the redux data rather than having the fetch being done at the page-level component".

I may have misinterpreted what you were saying.

Copy link
Contributor Author

@joshslee joshslee May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point though.

In the branch discussion-redux, I made this component also take care of the loading state so it may gives it (being a component) a bit more validity. Let me know what you want me to do

@@ -467,7 +473,7 @@ const DiscussionTab = (props) => {
type="beat"
/>
) : (
props.calculatedCount
<DiscussionCount />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@joshslee joshslee closed this May 5, 2021
@lightninglu10 lightninglu10 deleted the discussion-redux-count branch June 30, 2021 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants