Onboarding: Allow logo to be removed via customize appearance task (https://github.com/woocommerce/woocommerce-admin/pull/3323)
* Remove pending state when no custom logo ID exists * Update logo to null in theme mods if removed
This commit is contained in:
parent
09f2a03284
commit
fa2ab220c9
|
@ -54,7 +54,11 @@ class Appearance extends Component {
|
||||||
const step = this.getSteps()[ stepIndex ].key;
|
const step = this.getSteps()[ stepIndex ].key;
|
||||||
const isRequestSuccessful = ! isRequesting && prevProps.isRequesting && ! hasErrors;
|
const isRequestSuccessful = ! isRequesting && prevProps.isRequesting && ! hasErrors;
|
||||||
|
|
||||||
if ( themeMods && prevProps.themeMods.custom_logo !== themeMods.custom_logo ) {
|
if (
|
||||||
|
themeMods &&
|
||||||
|
themeMods.custom_logo &&
|
||||||
|
prevProps.themeMods.custom_logo !== themeMods.custom_logo
|
||||||
|
) {
|
||||||
/* eslint-disable react/no-did-update-set-state */
|
/* eslint-disable react/no-did-update-set-state */
|
||||||
this.setState( { isPending: true } );
|
this.setState( { isPending: true } );
|
||||||
wp.media
|
wp.media
|
||||||
|
@ -164,7 +168,7 @@ class Appearance extends Component {
|
||||||
updateLogo() {
|
updateLogo() {
|
||||||
const { options, themeMods, updateOptions } = this.props;
|
const { options, themeMods, updateOptions } = this.props;
|
||||||
const { logo } = this.state;
|
const { logo } = this.state;
|
||||||
const updateThemeMods = logo ? { ...themeMods, custom_logo: logo.id } : themeMods;
|
const updateThemeMods = { ...themeMods, custom_logo: logo ? logo.id : null };
|
||||||
|
|
||||||
recordEvent( 'tasklist_appearance_upload_logo' );
|
recordEvent( 'tasklist_appearance_upload_logo' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue