diff --git a/web/src/features/dialog/InputDialog.tsx b/web/src/features/dialog/InputDialog.tsx index 580c5df..702ca1b 100644 --- a/web/src/features/dialog/InputDialog.tsx +++ b/web/src/features/dialog/InputDialog.tsx @@ -66,15 +66,14 @@ const InputDialog: React.FC = () => { }); }); - useNuiEvent('closeInputDialog', () => { - setVisible(false); - }); + useNuiEvent('closeInputDialog', async () => await handleClose(true)); - const handleClose = async () => { + const handleClose = async (dontPost?: boolean) => { setVisible(false); await new Promise((resolve) => setTimeout(resolve, 200)); form.reset(); fieldForm.remove(); + if (dontPost) return; fetchNui('inputData'); };