Skip to content

Commit

Permalink
Update the local editor setting when enabling/disabling the block editor
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Feb 28, 2020
1 parent 4ff75c3 commit 4f01138
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions WordPress/src/main/java/org/wordpress/android/util/SiteUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,21 @@ public static boolean enableBlockEditorOnSiteCreation(Dispatcher dispatcher, Sit
}

public static void enableBlockEditor(Dispatcher dispatcher, SiteModel siteModel) {
dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorAction(
new DesignateMobileEditorPayload(siteModel, SiteUtils.GB_EDITOR_NAME)));
// Send the setting to the server
dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorAction(
new DesignateMobileEditorPayload(siteModel, GB_EDITOR_NAME)));
// Update the local site
siteModel.setMobileEditor(GB_EDITOR_NAME);
dispatcher.dispatch(SiteActionBuilder.newUpdateSiteAction(siteModel));
}

public static void disableBlockEditor(Dispatcher dispatcher, SiteModel siteModel) {
// Send the setting to the server
dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorAction(
new DesignateMobileEditorPayload(siteModel, SiteUtils.AZTEC_EDITOR_NAME)));
new DesignateMobileEditorPayload(siteModel, AZTEC_EDITOR_NAME)));
// Update the local site
siteModel.setMobileEditor(AZTEC_EDITOR_NAME);
dispatcher.dispatch(SiteActionBuilder.newUpdateSiteAction(siteModel));
}

public static boolean isBlockEditorDefaultForNewPost(SiteModel site) {
Expand Down

0 comments on commit 4f01138

Please sign in to comment.