Skip to content

Commit b41139f

Browse files
committed
Fix edit question modal bug
1 parent 2db6ce6 commit b41139f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/components/questions/question-form-modal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ const QuestionFormModal: React.FC<QuestionFormModalProps> = ({ ...props }) => {
5252
e.preventDefault();
5353

5454
props.handleSubmit(question);
55-
setQuestion(initialQuestionState);
55+
if (props.initialData) {
56+
setQuestion(props.initialData);
57+
} else {
58+
setQuestion(initialQuestionState);
59+
}
5660
};
5761

5862
const handleExit = () => {

0 commit comments

Comments
 (0)