Skip to content

Commit

Permalink
Merge pull request #18279 from wordpress-mobile/gutenberg/emit-editor…
Browse files Browse the repository at this point in the history
…-save-events

[Gutenberg] Emit editor save events
  • Loading branch information
Siobhan Bamber authored Apr 20, 2023
2 parents 2ed867f + 75a4b55 commit 99e80b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
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 = '2.25.0'
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

0 comments on commit 99e80b5

Please sign in to comment.