fix: remove duplicate code
This commit is contained in:
parent
88637c4776
commit
dc1f8f82f9
2 changed files with 8 additions and 7 deletions
|
|
@ -75,10 +75,7 @@ const TriggerView = ({
|
||||||
error={error?.message}
|
error={error?.message}
|
||||||
save={add}
|
save={add}
|
||||||
onClose={toggleWizard}
|
onClose={toggleWizard}
|
||||||
customInfoRequests={R.filter(
|
customInfoRequests={customInfoRequests}
|
||||||
it => it.enabled === true,
|
|
||||||
customInfoRequests
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{R.isEmpty(triggers) && (
|
{R.isEmpty(triggers) && (
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,10 @@ const GET_CUSTOM_REQUESTS = gql`
|
||||||
const Triggers = () => {
|
const Triggers = () => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
const [wizardType, setWizard] = useState(false)
|
const [wizardType, setWizard] = useState(false)
|
||||||
const { data, loading } = useQuery(GET_CONFIG)
|
const { data, loading: configLoading } = useQuery(GET_CONFIG)
|
||||||
const { data: customInfoReqData } = useQuery(GET_CUSTOM_REQUESTS)
|
const { data: customInfoReqData, loading: customInfoLoading } = useQuery(
|
||||||
|
GET_CUSTOM_REQUESTS
|
||||||
|
)
|
||||||
const [error, setError] = useState(null)
|
const [error, setError] = useState(null)
|
||||||
const [subMenu, setSubMenu] = useState(false)
|
const [subMenu, setSubMenu] = useState(false)
|
||||||
|
|
||||||
|
|
@ -94,6 +96,8 @@ const Triggers = () => {
|
||||||
return setWizard(wizardName)
|
return setWizard(wizardName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loading = configLoading || customInfoLoading
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TitleSection
|
<TitleSection
|
||||||
|
|
@ -178,7 +182,7 @@ const Triggers = () => {
|
||||||
showWizard={wizardType === 'newTrigger'}
|
showWizard={wizardType === 'newTrigger'}
|
||||||
config={data?.config ?? {}}
|
config={data?.config ?? {}}
|
||||||
toggleWizard={toggleWizard('newTrigger')}
|
toggleWizard={toggleWizard('newTrigger')}
|
||||||
customInfoRequests={customInfoRequests}
|
customInfoRequests={enabledCustomInfoRequests}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!loading && subMenu === 'advancedSettings' && (
|
{!loading && subMenu === 'advancedSettings' && (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue