This commit is contained in:
mgabdev 2020-05-14 23:46:10 -04:00
parent 805012ab72
commit e321c36c25
3 changed files with 9 additions and 8 deletions

View File

@ -260,7 +260,7 @@ export function handleComposeSubmit(dispatch, getState, response, status) {
}
}
export function submitCompose(group, replyToId = null, router) {
export function submitCompose(group, replyToId = null, router, isStandalone) {
return function (dispatch, getState) {
if (!me) return;
@ -299,7 +299,7 @@ export function submitCompose(group, replyToId = null, router) {
const scheduled_at = getState().getIn(['compose', 'scheduled_at'], null);
if (scheduled_at !== null) scheduled_at = moment.utc(scheduled_at).toDate();
if (isMobile(window.innerWidth) && router) {
if (isMobile(window.innerWidth) && router && isStandalone) {
router.history.goBack()
}

View File

@ -20,10 +20,11 @@ const mapStateToProps = (state) => ({
isPro: state.getIn(['accounts', me, 'is_pro']),
})
const mapDispatchToProps = (dispatch, { isPro }) => ({
setScheduledAt (date) {
const mapDispatchToProps = (dispatch) => ({
setScheduledAt (date, isPro) {
dispatch(closePopover())
if (!isPro) {
dispatch(closePopover())
return dispatch(openModal(MODAL_PRO_UPGRADE))
}
@ -49,11 +50,11 @@ class DatePickerPopover extends PureComponent {
}
handleSetDate = (date) => {
this.props.setScheduledAt(date)
this.props.setScheduledAt(date, this.props.isPro)
}
handleRemoveDate = () => {
this.props.setScheduledAt(null)
this.props.setScheduledAt(null, this.props.isPro)
}
render() {

View File

@ -91,7 +91,7 @@ const mapDispatchToProps = (dispatch, { reduxReplyToId, replyToId, isStandalone
},
onSubmit(group, replyToId, router) {
dispatch(submitCompose(group, replyToId, router))
dispatch(submitCompose(group, replyToId, router, isStandalone))
},
onClearSuggestions() {