kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'reblogs-fix' into 'develop'
fix reblogs with confirmation modal enabled See merge request soapbox-pub/soapbox-fe!948strip-front-mentions
commit
f596df3ec2
|
@ -66,8 +66,16 @@ const makeMapStateToProps = () => {
|
|||
return mapStateToProps;
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
const mapDispatchToProps = (dispatch, { intl }) => {
|
||||
function onModalReblog(status) {
|
||||
if (status.get('reblogged')) {
|
||||
dispatch(unreblog(status));
|
||||
} else {
|
||||
dispatch(reblog(status));
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
onReply(status, router) {
|
||||
dispatch((_, getState) => {
|
||||
const state = getState();
|
||||
|
@ -83,13 +91,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||
});
|
||||
},
|
||||
|
||||
onModalReblog(status) {
|
||||
if (status.get('reblogged')) {
|
||||
dispatch(unreblog(status));
|
||||
} else {
|
||||
dispatch(reblog(status));
|
||||
}
|
||||
},
|
||||
onModalReblog,
|
||||
|
||||
onReblog(status, e) {
|
||||
dispatch((_, getState) => {
|
||||
|
@ -97,7 +99,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||
if (e.shiftKey || !boostModal) {
|
||||
this.onModalReblog(status);
|
||||
} else {
|
||||
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
|
||||
dispatch(openModal('BOOST', { status, onReblog: onModalReblog }));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -233,7 +235,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||
onToggleStatusSensitivity(status) {
|
||||
dispatch(toggleStatusSensitivityModal(intl, status.get('id'), status.get('sensitive')));
|
||||
},
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
|
||||
|
|
Ładowanie…
Reference in New Issue