Web: Client: Data import fixed error toastr

This commit is contained in:
Elyor Djalilov 2024-03-11 14:12:16 +05:00
parent 1166edfcc4
commit 01300fdd26
2 changed files with 10 additions and 10 deletions

View File

@ -118,7 +118,7 @@ const SelectFileStep = ({
}
if (!res || res.parseResult.failedArchives.length > 0 || res.error) {
// toastr.error(res.error);
toastr.error(res.error || t("Common:SomethingWentWrong"));
setIsFileError(true);
clearInterval(uploadInterval.current);
} else if (res.isCompleted || res.progress === 100) {
@ -128,7 +128,7 @@ const SelectFileStep = ({
clearInterval(uploadInterval.current);
}
} catch (error) {
toastr.error(error.message);
toastr.error(error.message || t("Common:SomethingWentWrong"));
setIsFileError(true);
clearInterval(uploadInterval.current);
}
@ -173,7 +173,7 @@ const SelectFileStep = ({
}
if (!res || res.parseResult.failedArchives.length > 0 || res.error) {
// toastr.error(res.error);
toastr.error(res.error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
clearInterval(uploadInterval.current);
@ -186,7 +186,7 @@ const SelectFileStep = ({
setShowReminder(true);
}
} catch (error) {
toastr.error(error || error.message);
toastr.error(error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
setIsError(true);
@ -194,7 +194,7 @@ const SelectFileStep = ({
}
}, 1000);
} catch (error) {
toastr.error(error || error.message);
toastr.error(error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
}

View File

@ -117,7 +117,7 @@ const SelectFileStep = ({
}
if (!res || res.parseResult.failedArchives.length > 0 || res.error) {
toastr.error(res.error);
toastr.error(res.error || t("Common:SomethingWentWrong"));
setIsFileError(true);
clearInterval(uploadInterval.current);
} else if (res.isCompleted || res.progress === 100) {
@ -127,7 +127,7 @@ const SelectFileStep = ({
clearInterval(uploadInterval.current);
}
} catch (error) {
toastr.error(error.message);
toastr.error(error.message || t("Common:SomethingWentWrong"));
setIsFileError(true);
clearInterval(uploadInterval.current);
}
@ -168,7 +168,7 @@ const SelectFileStep = ({
}
if (!res || res.parseResult.failedArchives.length > 0 || res.error) {
toastr.error(res.error);
toastr.error(res.error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
clearInterval(uploadInterval.current);
@ -181,7 +181,7 @@ const SelectFileStep = ({
setShowReminder(true);
}
} catch (error) {
toastr.error(error || error.message);
toastr.error(error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
setIsError(true);
@ -189,7 +189,7 @@ const SelectFileStep = ({
}
}, 1000);
} catch (error) {
toastr.error(error || error.message);
toastr.error(error || t("Common:SomethingWentWrong"));
setIsFileError(true);
setIsFileLoading(false);
}