mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 20:35:56 +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],
|
queryKey: ['getPendingInvites', user?.accessJwt],
|
||||||
});
|
});
|
||||||
|
|
||||||
const toggleModal = (value: boolean): void => {
|
|
||||||
setIsInviteTeamMemberModalOpen(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [dataSource, setDataSource] = useState<DataProps[]>([]);
|
const [dataSource, setDataSource] = useState<DataProps[]>([]);
|
||||||
|
|
||||||
|
const toggleModal = useCallback(
|
||||||
|
(value: boolean): void => {
|
||||||
|
setIsInviteTeamMemberModalOpen(value);
|
||||||
|
if (!value) {
|
||||||
|
form.resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[form],
|
||||||
|
);
|
||||||
|
|
||||||
const { hash } = useLocation();
|
const { hash } = useLocation();
|
||||||
|
|
||||||
const getParsedInviteData = useCallback(
|
const getParsedInviteData = useCallback(
|
||||||
@ -79,7 +85,7 @@ function PendingInvitesContainer(): JSX.Element {
|
|||||||
if (hash === INVITE_MEMBERS_HASH) {
|
if (hash === INVITE_MEMBERS_HASH) {
|
||||||
toggleModal(true);
|
toggleModal(true);
|
||||||
}
|
}
|
||||||
}, [hash]);
|
}, [hash, toggleModal]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
@ -225,7 +231,13 @@ function PendingInvitesContainer(): JSX.Element {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[getParsedInviteData, getPendingInvitesResponse, notifications, t],
|
[
|
||||||
|
getParsedInviteData,
|
||||||
|
getPendingInvitesResponse,
|
||||||
|
notifications,
|
||||||
|
t,
|
||||||
|
toggleModal,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user