-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Listen for post save events #49781
Conversation
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
Flaky tests detected in daf06a3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4724789534
|
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.
LGTM 🎊 !
Related PRs
Gutenberg Mobile
: [RNMobile] Listen for post save events wordpress-mobile/gutenberg-mobile#5663iOS
: [Gutenberg] Emit editor save events wordpress-mobile/WordPress-iOS#20522Android
: [Gutenberg] Emit editor save events wordpress-mobile/WordPress-Android#18279What?
The changes in this PR introduce a way for Gutenberg Mobile to detect post save events that are emitted from the native apps.
Why?
There isn't currently a built-in way to detect when a post has been recently saved on native, which would be useful for certain functionality or blocks.
How?
For now, a
postHasBeenJustSaved
event is being emitted from the Android and iOS apps when a post is manually saved by a user. Different blocks are then able to set up an event listener. An example implementation can be found in Automattic/jetpack#30131.This PR focuses on creating an optional way to detect save events, but it could potentially serve as a base for linking up to Gutenberg's
isSavingPost
selector.Testing Instructions
With this branch applied, follow these steps in both the Android and iOS apps: