-
Notifications
You must be signed in to change notification settings - Fork 843
Social: Disable resharing and schedule buttons while operations are in progress #46321
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
Conversation
…n progress Adds global resharing state to the social store so both Schedule and Share buttons remain disabled while either operation is in progress.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
|
| ...initialState, | ||
| isFetching: true, | ||
| } ); | ||
| setIsResharing( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this state should be set inside the sharePost callback in src/components/share-post/index.jsx just before calling savePost.
Also, I think we can move this resharing API call to the store action itself and clean up that logic as it's no longer sync after we made resharing async and that async logic is still there. We can clean up that debt.
I was already looking into it a bit. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in DM, you took this over to do the mentioned bigger refactor, that not just fixes this issue, but cleans up logic a bit. For the future we could assign Linear tasks as early as thinking of solutions, so we can avoid duplicated efforts on the same issues
Fixes SOCIAL-269
Proposed changes:
This PR adds global resharing state to the social store so both Schedule and Share buttons remain disabled while either operation is in progress. Previously, there was a brief moment (~1 second) when the buttons became active again between saving and sharing operations.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
CleanShot.2025-12-16.at.12.54.49.mp4