diff --git a/client/my-sites/site-settings/podcasting-details/index.jsx b/client/my-sites/site-settings/podcasting-details/index.jsx index edcecf173427b..2a33471223e9f 100644 --- a/client/my-sites/site-settings/podcasting-details/index.jsx +++ b/client/my-sites/site-settings/podcasting-details/index.jsx @@ -24,6 +24,7 @@ import FormSettingExplanation from 'components/forms/form-setting-explanation'; import FormSelect from 'components/forms/form-select'; import FormTextarea from 'components/forms/form-textarea'; import HeaderCake from 'components/header-cake'; +import scrollTo from 'lib/scroll-to'; import QueryTerms from 'components/data/query-terms'; import TermTreeSelector from 'blocks/term-tree-selector'; import PodcastCoverImageSetting from 'my-sites/site-settings/podcast-cover-image-setting'; @@ -41,6 +42,7 @@ import { isRequestingTermsForQueryIgnoringPage, getTermsForQueryIgnoringPage, } from 'state/terms/selectors'; +import { isSavingSiteSettings } from 'state/site-settings/selectors'; class PodcastingDetails extends Component { renderExplicitContent() { @@ -85,6 +87,7 @@ class PodcastingDetails extends Component { primary={ true } type="submit" disabled={ isRequestingSettings || isSavingSettings || isRequestingCategories } + busy={ isSavingSettings } > { isSavingSettings ? translate( 'Saving…' ) : translate( 'Save Settings' ) } @@ -178,7 +181,14 @@ class PodcastingDetails extends Component { } render() { - const { handleSubmitForm, siteSlug, siteId, translate, isPodcastingEnabled } = this.props; + const { + handleSubmitForm, + siteSlug, + siteId, + translate, + isPodcastingEnabled, + isSavingSettings, + } = this.props; if ( ! siteId ) { return null; } @@ -212,7 +222,7 @@ class PodcastingDetails extends Component { { error || this.renderSettings() } { isPodcastingEnabled && (
-

@@ -349,7 +359,12 @@ class PodcastingDetails extends Component { }; onCategoryCleared = () => { - this.props.updateFields( { podcasting_category_id: '0' } ); + const { updateFields, submitForm } = this.props; + + updateFields( { podcasting_category_id: '0' }, () => { + submitForm(); + scrollTo( { y: 0 } ); + } ); }; onCoverImageRemoved = () => { @@ -414,6 +429,7 @@ const connectComponent = connect( ( state, ownProps ) => { podcastingFeedUrl, userCanManagePodcasting: canCurrentUser( state, siteId, 'manage_options' ), isUnsupportedSite: isJetpack && ! isAutomatedTransfer, + isSavingSettings: isSavingSiteSettings( state, siteId ), }; } ); diff --git a/client/my-sites/site-settings/wrap-settings-form.jsx b/client/my-sites/site-settings/wrap-settings-form.jsx index 595a02455be8b..6673e3475e96f 100644 --- a/client/my-sites/site-settings/wrap-settings-form.jsx +++ b/client/my-sites/site-settings/wrap-settings-form.jsx @@ -162,10 +162,12 @@ const wrapSettingsForm = getFormSettings => SettingsForm => { // Support site settings for older Jetpacks as needed const siteFields = pick( fields, settingsFields.site ); const apiVersion = siteIsJetpack ? jetpackSiteSettingsAPIVersion : '1.4'; - this.props.saveSiteSettings( siteId, { ...siteFields, apiVersion } ); + if ( jetpackSettingsUISupported ) { this.props.saveJetpackSettings( siteId, jetpackFieldsToUpdate ); } + + this.props.saveSiteSettings( siteId, { ...siteFields, apiVersion } ); }; handleRadio = event => {