mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 22:19:01 +08:00
FE: invite form is reset when closed (#2875)
* feat: add the options menu * fix: data is reset when modal is turned down --------- Co-authored-by: Palash <palashgdev@gmail.com>
This commit is contained in:
parent
04a9de1e32
commit
5af5cb0cf0
@ -55,12 +55,18 @@ function PendingInvitesContainer(): JSX.Element {
|
||||
queryKey: ['getPendingInvites', user?.accessJwt],
|
||||
});
|
||||
|
||||
const toggleModal = (value: boolean): void => {
|
||||
setIsInviteTeamMemberModalOpen(value);
|
||||
};
|
||||
|
||||
const [dataSource, setDataSource] = useState<DataProps[]>([]);
|
||||
|
||||
const toggleModal = useCallback(
|
||||
(value: boolean): void => {
|
||||
setIsInviteTeamMemberModalOpen(value);
|
||||
if (!value) {
|
||||
form.resetFields();
|
||||
}
|
||||
},
|
||||
[form],
|
||||
);
|
||||
|
||||
const { hash } = useLocation();
|
||||
|
||||
const getParsedInviteData = useCallback(
|
||||
@ -79,7 +85,7 @@ function PendingInvitesContainer(): JSX.Element {
|
||||
if (hash === INVITE_MEMBERS_HASH) {
|
||||
toggleModal(true);
|
||||
}
|
||||
}, [hash]);
|
||||
}, [hash, toggleModal]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
@ -225,7 +231,13 @@ function PendingInvitesContainer(): JSX.Element {
|
||||
});
|
||||
}
|
||||
},
|
||||
[getParsedInviteData, getPendingInvitesResponse, notifications, t],
|
||||
[
|
||||
getParsedInviteData,
|
||||
getPendingInvitesResponse,
|
||||
notifications,
|
||||
t,
|
||||
toggleModal,
|
||||
],
|
||||
);
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user