Commit e321c36c authored by mgabdev's avatar mgabdev

Progress

parent 805012ab
......@@ -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()
}
......
......@@ -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() {
......
......@@ -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() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment