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

solved issue with loader #575

Closed
wants to merge 2 commits into from
Closed

solved issue with loader #575

wants to merge 2 commits into from

Conversation

dwikov
Copy link

@dwikov dwikov commented Jun 21, 2021

  • Breaking change? (if so, please describe the impact and migration path for existing applications:)

What changes did you make? (Give an overview)
Removed checking for isSubmitting and add reset for isTopicCreated.
Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "X" next to an item)

  • No need to
  • Manually(please, describe, when necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "X" next to an item, otherwise PR will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings(e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

@dwikov dwikov requested review from GneyHabub and workshur June 21, 2021 15:02
Copy link
Member

@workshur workshur left a comment

Choose a reason for hiding this comment

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

I see that resetUploadedState dispatches createTopicAction.failure. Can we create separate action to reset state instead of using failure?

@dwikov
Copy link
Author

dwikov commented Jun 22, 2021

I see that resetUploadedState dispatches createTopicAction.failure. Can we create separate action to reset state instead of using failure?

Yeah that's why I didn't think it was a good idea to do it like this. We can create one more called createTopicAction.cancel and make it responsible for resetting the state.

@workshur
Copy link
Member

workshur commented Jun 25, 2021

@dwikov I think we can clear state right here, without adding new actions

const newState = {
...state,
byName: {
...state.byName,
[topic.name]: {
...topic,
},
},
allNames: [...state.allNames, topic.name],
};

@dwikov
Copy link
Author

dwikov commented Jun 25, 2021

@dwikov I think we can clear state right here, without adding new actions

const newState = {
...state,
byName: {
...state.byName,
[topic.name]: {
...topic,
},
},
allNames: [...state.allNames, topic.name],
};

We can clear the state of topics here, the issue is with the loader state. As far as I understand, the reducer of the loader changes the state of the loader according to the action called, success fail or fetching.

@sonarqubecloud
Copy link

Copy link
Member

@workshur workshur left a comment

Choose a reason for hiding this comment

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

We're on the wrong track. Loader reducer used only for async actions

@workshur workshur closed this Jul 29, 2021
@workshur workshur deleted the Fix-loader-issue branch April 22, 2022 08:54
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