Переглянути джерело

fixed dispatching saga method bug

FE_dev
Dzenis Hadzifejzovic 3 роки тому
джерело
коміт
375d6215c2
2 змінених файлів з 17 додано та 5 видалено
  1. 11
    2
      src/pages/FilesPage/AddFile.js
  2. 6
    3
      src/pages/FilesPage/FilesPage.js

+ 11
- 2
src/pages/FilesPage/AddFile.js Переглянути файл

@@ -34,10 +34,19 @@ const AddFile = ({ history }) => {
const { t } = useTranslation();

useEffect(() => {
dispatch(setCategoriesReq());
dispatch(
setCategoriesReq({
parentCategoryId: undefined,
onNull: onNullCategories,
})
);
dispatch(setTagsReq());
}, []);

const onNullCategories = () => {
history.push(FILES_PAGE);
};

const onSuccessUploadFile = () => {
dispatch(resetIsCheckedTagsValue());
setPdfFile(null);
@@ -231,7 +240,7 @@ const AddFile = ({ history }) => {
<div className="files-page-card">
<div
className="files-page-card-add-button"
style={{ alignItems: "center" }}
style={{ alignItems: "center", position: "relative" }}
>
<p
className="applicant-ads-back-button"

+ 6
- 3
src/pages/FilesPage/FilesPage.js Переглянути файл

@@ -51,7 +51,6 @@ const FilesPage = ({ history }) => {
}, [id]);

const onNullCategories = () => {
console.log("JJJJSSSSSSJ")
history.push(FILES_PAGE);
};

@@ -71,7 +70,11 @@ const FilesPage = ({ history }) => {

const onSuccessCreatingCategoryHandler = () => {
dispatch(
setCategoriesReq(id === undefined ? undefined : { parentCategoryId: id })
setCategoriesReq(
id === undefined
? { parentCategoryId: undefined, onNull: onNullCategories }
: { parentCategoryId: id, onNull: onNullCategories }
)
);
setOpenCreateCategoryModal(false);
};
@@ -100,7 +103,7 @@ const FilesPage = ({ history }) => {
return (
<>
<div className="l-t-rectangle"></div>
<div className="r-b-rectangle"></div>
<div className="r-b-rectangle" style={{width:matches ? 100 : 180}}></div>
<CustomModal
classes="files-custom-modal"
open={openCreateCategoryModal}

Завантаження…
Відмінити
Зберегти