Set default value for performanceIndicators var (https://github.com/woocommerce/woocommerce-admin/pull/7343)

* Set default value for performanceIndicators var
This commit is contained in:
Moon 2021-07-13 20:09:02 -07:00 committed by GitHub
parent 40be342865
commit 303e6ff84c
3 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,12 @@
# Testing instructions
## Unreleased
### Fix WC Home crash when the Analytics is disabled.
1. Navigate to WooCommerce -> Settings -> Advanced -> Features. Uncheck Analytics and save the changes.
2. Navigate to WooCommerce -> Home and confirm the page loads without an error.
### Fix missing translation strings for CES #7270
1. Navigate to Settings -> General and change the site language to a non-English (I've used Espanol for testing purposes).

View File

@ -0,0 +1,4 @@
Significance: patch
Type: Fix
Set default value for performanceIndicators variable #7343

View File

@ -33,9 +33,10 @@ import { DEFAULT_STATS, DEFAULT_HIDDEN_STATS } from './defaults';
import StatsList from './stats-list';
import { InstallJetpackCTA } from './install-jetpack-cta';
const { performanceIndicators } = getSetting( 'dataEndpoints', {
const { performanceIndicators = [] } = getSetting( 'dataEndpoints', {
performanceIndicators: [],
} );
const stats = performanceIndicators.filter( ( indicator ) => {
return DEFAULT_STATS.includes( indicator.stat );
} );