Skip to content

Commit

Permalink
fix: selectCategoryIdByTree This is a no-op, memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidZORO committed Jun 5, 2020
1 parent ba160a2 commit 2cdcff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const SelectCategoryIdByTree = (props: IProps) => {
if (!isAjaxCancelled.current) setTree(res.data?.data);
})
.catch((err: IHttpError) => errorMsg(err.response?.data?.message || err.message))
.finally(() => setTreeLoading(false));
.finally(() => !isAjaxCancelled.current && setTreeLoading(false));
};

const onChange = (v?: string | string[] | null) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const TagSearchBox = forwardRef((props: IProps, ref: React.Ref<any>) => {
// console.log(err.response?.data?.message || err.message);
errorMsg(err.response?.data?.message || err.message);
})
.finally(() => setLoading(false));
.finally(() => isAjaxCancelled.current && setLoading(false));
};

// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit 2cdcff8

Please sign in to comment.