This commit is contained in:
mgabdev
2020-04-23 23:17:27 -04:00
parent e2e7e8c0af
commit 01c8041a6a
73 changed files with 905 additions and 1002 deletions

View File

@@ -108,21 +108,33 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
});
},
onQuote (status, router) {
onRepost (targetRef, status, ) {
if (!me) return dispatch(openModal('UNAUTHORIZED'))
dispatch(openPopover('REPOST_OPTIONS', {
status,
targetRef,
position: 'top',
}))
dispatch((_, getState) => {
const state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.quoteMessage),
confirm: intl.formatMessage(messages.quoteConfirm),
onConfirm: () => dispatch(quoteCompose(status, router)),
}));
} else {
dispatch(quoteCompose(status, router));
}
});
// if (e.shiftKey || !boostModal) {
// this.onModalRepost(status);
// } else {
// dispatch(openModal('BOOST', { status, onRepost: this.onModalRepost }));
// }
// dispatch((_, getState) => {
// const state = getState();
// if (state.getIn(['compose', 'text']).trim().length !== 0) {
// dispatch(openModal('CONFIRM', {
// message: intl.formatMessage(messages.quoteMessage),
// confirm: intl.formatMessage(messages.quoteConfirm),
// onConfirm: () => dispatch(quoteCompose(status, router)),
// }));
// } else {
// dispatch(quoteCompose(status, router));
// }
// });
},
onModalRepost (status) {
@@ -143,16 +155,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}))
},
onRepost (status, e) {
if (!me) return dispatch(openModal('UNAUTHORIZED'))
if (e.shiftKey || !boostModal) {
this.onModalRepost(status);
} else {
dispatch(openModal('BOOST', { status, onRepost: this.onModalRepost }));
}
},
onShowRevisions (status) {
if (!me) return dispatch(openModal('UNAUTHORIZED'))