From c1e5ae7922ce4c15c8fe052d9edf4f40b7b59e98 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 27 Nov 2024 10:39:08 -0300 Subject: [PATCH] fix: deprecate Salesforce --- includes/wizards/audience/class-audience-wizard.php | 2 ++ src/components/src/handoff-message/index.js | 3 --- src/wizards/audience/views/setup/setup.js | 8 ++++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/wizards/audience/class-audience-wizard.php b/includes/wizards/audience/class-audience-wizard.php index f39c036a30..4cd744c2c9 100644 --- a/includes/wizards/audience/class-audience-wizard.php +++ b/includes/wizards/audience/class-audience-wizard.php @@ -78,10 +78,12 @@ public function enqueue_scripts_and_styles() { return; } parent::enqueue_scripts_and_styles(); + $salesforce_settings = Salesforce::get_salesforce_settings(); $data = [ 'has_memberships' => class_exists( 'WC_Memberships' ), 'reader_activation_url' => admin_url( 'admin.php?page=newspack-audience#/' ), 'esp_metadata_fields' => Reader_Activation\Sync\Metadata::get_default_fields(), + 'can_use_salesforce' => ! empty( $salesforce_settings['client_id'] ), 'salesforce_redirect_url' => Salesforce::get_redirect_url(), ]; diff --git a/src/components/src/handoff-message/index.js b/src/components/src/handoff-message/index.js index ba8ecaa290..ea4bcf1e73 100644 --- a/src/components/src/handoff-message/index.js +++ b/src/components/src/handoff-message/index.js @@ -30,9 +30,6 @@ export default function HandoffMessage() { setHandoffMessage( false ); } }, 100 ); - - // Clean up the notification when unmounting. - return () => window.localStorage.removeItem( HANDOFF_KEY ); }, [] ); if ( ! handoffMessage ) { return null; diff --git a/src/wizards/audience/views/setup/setup.js b/src/wizards/audience/views/setup/setup.js index e6efefa215..065cbeab01 100644 --- a/src/wizards/audience/views/setup/setup.js +++ b/src/wizards/audience/views/setup/setup.js @@ -376,8 +376,12 @@ export default withWizardScreen( ( { config, fetchConfig, updateConfig, saveConf ) } -
- + { newspackAudience.can_use_salesforce && ( + <> +
+ + + ) } ) }