Clear text field in state after posting in Compose

This commit is contained in:
Marquis Kurt 2020-01-24 11:11:26 -05:00
parent f2fe5cbb31
commit a922d58d20
No known key found for this signature in database
GPG Key ID: 725636D259F5402D
1 changed files with 7 additions and 1 deletions

View File

@ -626,9 +626,15 @@ class Composer extends Component<any, IComposerState> {
: null
})
// If we succeed, send a success message and go back.
// If we succeed, send a success message, clear the status
// text field, and go back.
.then(() => {
this.props.enqueueSnackbar("Posted!");
// This is necessary to prevent session drafts from saving
// posts that were already posted.
this.setState({ text: "" });
window.history.back();
})