web: files: fix fields validation without credentials data

This commit is contained in:
Vladislav Makhov 2021-01-15 12:52:21 +03:00
parent 7e992ef248
commit 52ac07dde9

View File

@ -106,15 +106,12 @@ const PureConnectDialogContainer = (props) => {
const onChangeFolderName = (e) => setCustomerTitleValue(e.target.value);
const onChangeMakeShared = (e) => setMakeShared(!isCorporate);
const isEmptyField = [
urlValue,
loginValue,
passwordValue,
customerTitle,
].some((el) => el.trim().length === 0);
const providerData = [customerTitle];
if (!item.link) providerData.push(urlValue, loginValue, passwordValue);
const isEmptyField = providerData.some((el) => el.trim().length === 0);
const onSave = () => {
//if (isEmptyField) return toastr.error(t("EmptyField"));
if (isEmptyField) return toastr.error(t("EmptyField"));
onClose();
setIsLoading(true);