diff --git a/src/components/KonnectorEdit.jsx b/src/components/KonnectorEdit.jsx index 4bff5a4f43..bc890fe92c 100644 --- a/src/components/KonnectorEdit.jsx +++ b/src/components/KonnectorEdit.jsx @@ -13,6 +13,28 @@ import KonnectorSync from './KonnectorSync' import { ACCOUNT_ERRORS } from '../lib/accounts' +const NotExistingDirErrorDescription = ({ t, connector }) => () + +const GlobalErrorDescription = ({ t, connector }) => () + +const getErrorDescription = (props) => { + const { error } = props + switch (error.message) { + case ACCOUNT_ERRORS.NOT_EXISTING_DIRECTORY: + return () + default: + return () + } +} + export const KonnectorEdit = ({ t, account, connector, deleting, disableSuccessTimeout, driveUrl, error, fields, folderPath, isUnloading, lastSync, oAuthTerminated, onCancel, onDelete, onForceConnection, onSubmit, submitting, success }) => { const warningIcon = } @@ -24,11 +46,7 @@ export const KonnectorEdit = ({ t, account, connector, deleting, disableSuccessT return ( - { hasErrorExceptLogin && } + { hasErrorExceptLogin && getErrorDescription({t, error, connector})}