Merge pull request #18065 from influxdata/fix_add_defaultTo

fix: change null to empty array for default value
pull/18066/head
Michael Desa 2020-05-12 13:18:33 -07:00 committed by GitHub
commit 33e0184908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
import React, {FC} from 'react'
import {Link} from 'react-router'
import {connect} from 'react-redux'
import {get} from 'lodash'
import {get, defaultTo} from 'lodash'
// Components
import CloudOnly from 'src/shared/components/cloud/CloudOnly'
@ -38,7 +38,7 @@ const CloudUpgradeButton: FC<StateProps> = ({inView}) => {
}
const mstp = (state: AppState) => {
const settings = get(state, 'cloud.orgSettings.settings', [])
const settings = defaultTo(get(state, 'cloud.orgSettings.settings', []), [])
const hideUpgradeButtonSetting = settings.find(
(setting: OrgSetting) => setting.key === HIDE_UPGRADE_CTA_KEY
)

View File

@ -2,7 +2,7 @@
import React, {FC} from 'react'
import {Link} from 'react-router'
import {connect} from 'react-redux'
import {get} from 'lodash'
import {get, defaultTo} from 'lodash'
// Components
import {
@ -73,7 +73,7 @@ const CloudUpgradeNavBanner: FC<StateProps> = ({inView}) => {
}
const mstp = (state: AppState) => {
const settings = get(state, 'cloud.orgSettings.settings', [])
const settings = defaultTo(get(state, 'cloud.orgSettings.settings', []), [])
const hideUpgradeButtonSetting = settings.find(
(setting: OrgSetting) => setting.key === HIDE_UPGRADE_CTA_KEY
)