Skip to content

Commit 3634b32

Browse files
[docs-infra] Block than more feedback submissions (#46824)
Signed-off-by: Olivier Tassinari <oliviertassinari@users.noreply.github.com> Co-authored-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
1 parent 37b40af commit 3634b32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/src/modules/components/AppLayoutDocsFooter.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,13 @@ export default function AppLayoutDocsFooter(props) {
336336

337337
const handleSubmitComment = (event) => {
338338
event.preventDefault();
339+
// Block more than one submission.
340+
// Technically, setState() is async in React, so a ninja user could still
341+
// manage to trigger a double form submission. Still, let's wait and see
342+
// before adding the overhead of a React ref to solve this.
343+
if (!commentOpen) {
344+
return;
345+
}
339346
setCommentOpen(false);
340347
processFeedback();
341348
};

0 commit comments

Comments
 (0)