Redirect on success for standalone compose (#35763)
This commit is contained in:
parent
5f4116a311
commit
1675eab561
5 changed files with 14 additions and 6 deletions
|
|
@ -34,7 +34,7 @@ const mapStateToProps = state => ({
|
|||
maxChars: state.getIn(['server', 'server', 'configuration', 'statuses', 'max_characters'], 500),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
const mapDispatchToProps = (dispatch, props) => ({
|
||||
|
||||
onChange (text) {
|
||||
dispatch(changeCompose(text));
|
||||
|
|
@ -47,7 +47,11 @@ const mapDispatchToProps = (dispatch) => ({
|
|||
modalProps: {},
|
||||
}));
|
||||
} else {
|
||||
dispatch(submitCompose());
|
||||
dispatch(submitCompose((status) => {
|
||||
if (props.redirectOnSuccess) {
|
||||
window.location.assign(status.url);
|
||||
}
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue