-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add context for sync sites #642
Conversation
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.
The functionality works for me as expected. I reviewed the code and it looks good. One thing that I am wondering is whether we should break sync-sites-context
into a couple of different files so that its responsibilities are limited to providing state and context for the connected sites and sync states.
For instance, we could move the use-site-sync-management
and the hook for pulling operation into two different files and then pass through the context? My concern is that if we also add the push operation to this, that file will be hard to manage and navigate.
…irectly from a component by mistake
…ed to downloading
…taging and production
…dio into add/sync-context
@katinthehatsite , great observation. I've refactored the code to be every main hook in a separate file. I've grouped them inside the same folder to indicate they belong to a given context. I also moved the state to the context so that way we reduce the risk of small hooks being used directly from the components. Let me know what you think. Thank you! |
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.
Thanks for making the changes, I think the code is much more readable right now 😍
…tate on drop zone
…isconnecting section
…dio into add/sync-context
@sejas when I use a timeout snippet, and I open a site that has connected sites, and then switch to another site, I see connected site from the previous site for a while. It works well without the snippet, though. |
Thanks for testing it, and finding that "glitch" when changing sites. |
Proposed Changes
Testing Instructions
Apply this diff to better highlight the loading time for reading connected sites.
STUDIO_SITE_SYNC=true npm start
Pre-merge Checklist