From fa2ab220c97600e22ce37cc721f3232304031bb9 Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Tue, 3 Dec 2019 12:42:57 +0800 Subject: [PATCH] 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 --- .../client/dashboard/task-list/tasks/appearance.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/appearance.js b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/appearance.js index 52a2a2bb139..0cc5aff5597 100644 --- a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/appearance.js +++ b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/appearance.js @@ -54,7 +54,11 @@ class Appearance extends Component { const step = this.getSteps()[ stepIndex ].key; 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 */ this.setState( { isPending: true } ); wp.media @@ -164,7 +168,7 @@ class Appearance extends Component { updateLogo() { const { options, themeMods, updateOptions } = this.props; 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' );