Merge pull request #18065 from influxdata/fix_add_defaultTo
fix: change null to empty array for default valuepull/18066/head
commit
33e0184908
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue