Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复指标操作格式之后数据混乱的问题 #1637

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/src/app/hooks/useStateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ function useStateModal({ initState }: { initState?: any }) {
Object.create(null),
...spreadParmas,
);
// @TM 清空
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great, the modal should be recreated after close, but...so, it is better to clear the ref state, 👍🏿 .
Additional, could you remove the todo comment on this? the fix is ok for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great, the modal should be recreated after close, but...so, it is better to clear the ref state, 👍🏿 . Additional, could you remove the todo comment on this? the fix is ok for me.

ok

stateRef.current = {};
if (isPromise(okCBResult)) return okCBResult;
} catch (e) {
console.error('useStateModal | exception message ---> ', e);
Expand All @@ -74,6 +76,8 @@ function useStateModal({ initState }: { initState?: any }) {
};

const handleClickCancelButton = () => {
// @TM 清空
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as above.

stateRef.current = {};
cancelCallbackRef.current?.call(Object.create(null), null);
};

Expand Down