diff --git a/plugins/woocommerce-admin/client/dashboard/customizable.js b/plugins/woocommerce-admin/client/dashboard/customizable.js index 30ababcaa14..1b7e941e603 100644 --- a/plugins/woocommerce-admin/client/dashboard/customizable.js +++ b/plugins/woocommerce-admin/client/dashboard/customizable.js @@ -73,6 +73,7 @@ const mergeSectionsWithDefaults = ( prefSections ) => { const CustomizableDashboard = ( { defaultDateRange, + homepageEnabled, path, query, taskListComplete, @@ -92,7 +93,7 @@ const CustomizableDashboard = ( { const sections = dashSections || defaultSections; - const isTaskListEnabled = isOnboardingEnabled() && ! taskListHidden; + const isTaskListEnabled = ! homepageEnabled && isOnboardingEnabled() && ! taskListHidden; const isDashboardShown = ! isTaskListEnabled || ( ! query.task && taskListComplete ); diff --git a/plugins/woocommerce-admin/src/Features/AnalyticsDashboard.php b/plugins/woocommerce-admin/src/Features/AnalyticsDashboard.php index e928ac61a79..6308b309ef5 100644 --- a/plugins/woocommerce-admin/src/Features/AnalyticsDashboard.php +++ b/plugins/woocommerce-admin/src/Features/AnalyticsDashboard.php @@ -45,6 +45,7 @@ class AnalyticsDashboard { add_action( 'admin_menu', array( $this, 'register_page' ) ); // priority is 20 to run after https://github.com/woocommerce/woocommerce/blob/a55ae325306fc2179149ba9b97e66f32f84fdd9c/includes/admin/class-wc-admin-menus.php#L165. add_action( 'admin_head', array( $this, 'update_link_structure' ), 20 ); + add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) ); } /** @@ -78,6 +79,18 @@ class AnalyticsDashboard { ); } + /** + * Preload options to prime state of the application. + * + * @param array $options Array of options to preload. + * @return array + */ + public function preload_options( $options ) { + $options[] = 'woocommerce_homescreen_enabled'; + + return $options; + } + /** * Registers dashboard page. */