瀏覽代碼

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}

Loading…
取消
儲存