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

[Gutenberg] Emit editor save events #18279

Merged
merged 12 commits into from
Apr 20, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,9 @@ private void setGutenbergEnabledIfNeeded() {
}

private ActivityFinishState savePostOnline(boolean isFirstTimePublish) {
if (mEditorFragment instanceof GutenbergEditorFragment) {
((GutenbergEditorFragment) mEditorFragment).sendToJSPostSaveEvent();
}
return mViewModel.savePostOnline(isFirstTimePublish, this, mEditPostRepository, mSite);
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ext {
automatticRestVersion = '1.0.8'
automatticStoriesVersion = '2.1.0'
automatticTracksVersion = '2.2.0'
gutenbergMobileVersion = 'v1.93.0'
gutenbergMobileVersion = 'v1.94.0-alpha1'
wordPressAztecVersion = 'v1.6.3'
wordPressFluxCVersion = 'trunk-c4f88d5272c51d59cb7763681699b5925d76dace'
wordPressLoginVersion = '1.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ public void toggleHtmlMode() {
mWPAndroidGlueCode.toggleEditorMode(mHtmlModeEnabled);
}

public void sendToJSPostSaveEvent() {
mWPAndroidGlueCode.sendToJSPostSaveEvent();
}

/**
* Returns the contents of the content field from the JavaScript editor. Should be called from a background thread
* where possible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,10 @@ private void toggleHtmlMode() {
getGutenbergContainerFragment().toggleHtmlMode();
}

public void sendToJSPostSaveEvent() {
getGutenbergContainerFragment().sendToJSPostSaveEvent();
}

/*
* TODO: REMOVE THIS ONCE AZTEC COMPLETELY REPLACES THE VISUAL EDITOR IN WPANDROID APP
*/
Expand Down