Proposal: a modern & typed way of writing Redux actions doing API requests (#30270)
This commit is contained in:
1 parent
3a862439df
commit
10ec421dd4
14 files changed
+281
-125
No files matched your search
@@ -74,12 +74,12 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
},
|
||||
|
||||
onModalReblog (status, privacy) {
|
||||
dispatch(reblog(status, privacy));
|
||||
dispatch(reblog(status.id, privacy));
|
||||
},
|
||||
|
||||
onReblog (status, e) {
|
||||
if (status.get('reblogged')) {
|
||||
dispatch(unreblog(status));
|
||||
dispatch(unreblog(status.id));
|
||||
} else {
|
||||
if (e.shiftKey || !boostModal) {
|
||||
this.onModalReblog(status);
|
||||
|
||||
@@ -299,7 +299,7 @@ class Status extends ImmutablePureComponent {
|
||||
};
|
||||
|
||||
handleModalReblog = (status, privacy) => {
|
||||
this.props.dispatch(reblog(status, privacy));
|
||||
this.props.dispatch(reblog(status.id, privacy));
|
||||
};
|
||||
|
||||
handleReblogClick = (status, e) => {
|
||||
@@ -308,7 +308,7 @@ class Status extends ImmutablePureComponent {
|
||||
|
||||
if (signedIn) {
|
||||
if (status.get('reblogged')) {
|
||||
dispatch(unreblog(status));
|
||||
dispatch(unreblog(status.id));
|
||||
} else {
|
||||
if ((e && e.shiftKey) || !boostModal) {
|
||||
this.handleModalReblog(status);
|
||||
|
||||
Reference in new issue
Block a user