Skip to content

Commit

Permalink
Clear reply form after submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Feb 12, 2024
1 parent 8e67243 commit 84b31e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/common/components/comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface Props {
updateActiveUser: (data?: Account) => void;
deleteUser: (username: string) => void;
toggleUIProp: (what: ToggleType) => void;
onSubmit: (text: string) => void;
onSubmit: (text: string) => Promise<any>;
resetSelection?: () => void;
onCancel?: () => void;
inputRef?: Ref<any>;
Expand Down Expand Up @@ -154,10 +154,11 @@ export class Comment extends Component<Props, State> {
}, 50);
};

submit = () => {
submit = async () => {
const { text } = this.state;
const { onSubmit } = this.props;
onSubmit(text);
await onSubmit(text);
this.setState({ text: "" });
};

cancel = () => {
Expand Down

0 comments on commit 84b31e3

Please sign in to comment.