Clear text field in state after posting in Compose
This commit is contained in:
parent
f2fe5cbb31
commit
a922d58d20
|
@ -626,9 +626,15 @@ class Composer extends Component<any, IComposerState> {
|
||||||
: null
|
: 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(() => {
|
.then(() => {
|
||||||
this.props.enqueueSnackbar("Posted!");
|
this.props.enqueueSnackbar("Posted!");
|
||||||
|
|
||||||
|
// This is necessary to prevent session drafts from saving
|
||||||
|
// posts that were already posted.
|
||||||
|
this.setState({ text: "" });
|
||||||
|
|
||||||
window.history.back();
|
window.history.back();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue