🐛 Fix crash if integration is not defined
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Stack } from '@mantine/core';
|
||||
import { UseFormReturnType } from '@mantine/form';
|
||||
import { IconKey, IconKeyOff, IconLock, IconLockOff, IconUser, IconUserOff } from '@tabler/icons';
|
||||
import { ServiceType } from '../../../../../../../../../types/service';
|
||||
import { ServiceType } from '../../../../../../../../types/service';
|
||||
import { GenericSecretInput } from '../InputElements/GenericSecretInput';
|
||||
|
||||
interface IntegrationOptionsRendererProps {
|
||||
@@ -31,7 +31,7 @@ const secretMappings = [
|
||||
|
||||
export const IntegrationOptionsRenderer = ({ form }: IntegrationOptionsRendererProps) => (
|
||||
<Stack spacing="xs" mb="md">
|
||||
{Object.entries(form.values.integration.properties).map((entry) => {
|
||||
{form.values.integration && Object.entries(form.values.integration.properties).map((entry) => {
|
||||
const mapping = secretMappings.find((item) => item.label === entry[0]);
|
||||
const isPresent = entry[1] !== undefined;
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ interface IntegrationTabProps {
|
||||
|
||||
export const IntegrationTab = ({ form }: IntegrationTabProps) => {
|
||||
const { t } = useTranslation('');
|
||||
const hasIntegrationSelected = form.values.integration !== null;
|
||||
const hasIntegrationSelected =
|
||||
form.values.integration && Object.keys(form.values.integration.properties).length;
|
||||
|
||||
return (
|
||||
<Tabs.Panel value="integration" pt="lg">
|
||||
|
||||
Reference in New Issue
Block a user