Skip to content

Commit 38758b9

Browse files
authored
fix(feedback): Fix timeout on feedback submission (#11619)
The timeout id wasn't getting reset to null after submission which was causing additional clicks on the feedback button to pop up the success message instead. Now, a click on the success message brings back the feedback button, which brings up the dialog when clicked. Fixes [#418](https://github.com/getsentry/team-replay/issues/418)
1 parent 8b6f838 commit 38758b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/feedback/src/modal/components/DialogContainer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export function DialogComponent({ open, onFormSubmitted, successMessageText, ...
3333
const onSubmitSuccess = useCallback(
3434
(data: FeedbackFormData) => {
3535
props.onSubmitSuccess(data);
36-
setTimeoutId(() => setTimeout(onFormSubmitted, SUCCESS_MESSAGE_TIMEOUT));
36+
setTimeoutId(
37+
setTimeout(() => {
38+
onFormSubmitted();
39+
setTimeoutId(null);
40+
}, SUCCESS_MESSAGE_TIMEOUT),
41+
);
3742
},
3843
[onFormSubmitted],
3944
);

0 commit comments

Comments
 (0)