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

Reset isForkingSandbox on error #1859

Merged
merged 2 commits into from
May 11, 2019

Conversation

ValentinH
Copy link
Contributor

Close #1803.

I'm not sure what's the best way to reset some state on error with Cerebral though.
Basically, I'd like to be able to always reset this state at the end of the forkSandbox sequence (https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/app/store/sequences.js#L162) instead of doing this in every single action called by this sequence.

Close codesandbox#1803.

I'm not sure what's the best way to reset some state on error with Cerebral though.
Basically, I'd like to be able to always reset this state at the end of the `forkSandbox` sequence (https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/app/store/sequences.js#L162) instead of doing this in every single action called by this sequence.
@CompuIves
Copy link
Member

This is a good approach! I think a bit cleaner approach would be to use paths, like we do here: https://github.com/codesandbox/codesandbox-client/blob/master/packages/app/src/app/store/sequences.js#L492-L496. In that example in the action we import path and in a successful case we return path.success(), otherwise path.error().

@ValentinH
Copy link
Contributor Author

Hey @CompuIves, I've updated to paths. Let me know if this matches what you had in mind 🙂

@SaraVieira
Copy link
Contributor

Looks good!

Thank you!

@SaraVieira SaraVieira merged commit fa6bb49 into codesandbox:master May 11, 2019
@ValentinH ValentinH deleted the reset-isforking-on-error branch May 11, 2019 07:55
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.

"Fork" button doesn't reset its state on fork error
3 participants