sforkowany z mirror/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;
|
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) {
|
onReply(status, router) {
|
||||||
dispatch((_, getState) => {
|
dispatch((_, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
@ -83,13 +91,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onModalReblog(status) {
|
onModalReblog,
|
||||||
if (status.get('reblogged')) {
|
|
||||||
dispatch(unreblog(status));
|
|
||||||
} else {
|
|
||||||
dispatch(reblog(status));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onReblog(status, e) {
|
onReblog(status, e) {
|
||||||
dispatch((_, getState) => {
|
dispatch((_, getState) => {
|
||||||
|
@ -97,7 +99,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
if (e.shiftKey || !boostModal) {
|
if (e.shiftKey || !boostModal) {
|
||||||
this.onModalReblog(status);
|
this.onModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
|
dispatch(openModal('BOOST', { status, onReblog: onModalReblog }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -233,7 +235,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
onToggleStatusSensitivity(status) {
|
onToggleStatusSensitivity(status) {
|
||||||
dispatch(toggleStatusSensitivityModal(intl, status.get('id'), status.get('sensitive')));
|
dispatch(toggleStatusSensitivityModal(intl, status.get('id'), status.get('sensitive')));
|
||||||
},
|
},
|
||||||
|
};
|
||||||
});
|
};
|
||||||
|
|
||||||
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
|
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
|
||||||
|
|
Ładowanie…
Reference in New Issue