Fix to invert button behavior with Shift key
This commit is contained in:
parent
d3ef510fd6
commit
059cb8f8f7
12 changed files with 19 additions and 19 deletions
|
@ -41,7 +41,7 @@ class Account extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -49,7 +49,7 @@ class Account extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AccountActionBar extends ImmutablePureComponent {
|
||||||
]
|
]
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -44,7 +44,7 @@ class AccountActionBar extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -111,7 +111,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
onReblog (status, e) {
|
onReblog (status, e) {
|
||||||
if ((e && e.shiftKey) || !boostModal) {
|
if ((e && e.shiftKey) ^ !boostModal) {
|
||||||
this.onModalReblog(status);
|
this.onModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
||||||
|
|
|
@ -129,7 +129,7 @@ class Header extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -137,7 +137,7 @@ class Header extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default class Header extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -44,7 +44,7 @@ export default class Header extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -168,7 +168,7 @@ class AccountCard extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -176,7 +176,7 @@ class AccountCard extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -179,7 +179,7 @@ class AccountCard extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -187,7 +187,7 @@ class AccountCard extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -178,7 +178,7 @@ class GroupDetail extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleFollow = (e) => {
|
handleFollow = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onFollow(this.props.account);
|
this.props.onFollow(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
@ -186,7 +186,7 @@ class GroupDetail extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubscribe = (e) => {
|
handleSubscribe = (e) => {
|
||||||
if ((e && e.shiftKey) || !follow_button_to_list_adder) {
|
if ((e && e.shiftKey) ^ !follow_button_to_list_adder) {
|
||||||
this.props.onSubscribe(this.props.account);
|
this.props.onSubscribe(this.props.account);
|
||||||
} else {
|
} else {
|
||||||
this.props.onAddToList(this.props.account);
|
this.props.onAddToList(this.props.account);
|
||||||
|
|
|
@ -47,7 +47,7 @@ const mapDispatchToProps = dispatch => ({
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
dispatch(unreblog(status));
|
dispatch(unreblog(status));
|
||||||
} else {
|
} else {
|
||||||
if (e.shiftKey || !boostModal) {
|
if (e.shiftKey ^ !boostModal) {
|
||||||
this.onModalReblog(status);
|
this.onModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
||||||
|
|
|
@ -105,7 +105,7 @@ class Footer extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
dispatch(unreblog(status));
|
dispatch(unreblog(status));
|
||||||
} else if ((e && e.shiftKey) || !boostModal) {
|
} else if ((e && e.shiftKey) ^ !boostModal) {
|
||||||
this._performReblog(status);
|
this._performReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(initBoostModal({ status, onReblog: this._performReblog }));
|
dispatch(initBoostModal({ status, onReblog: this._performReblog }));
|
||||||
|
|
|
@ -86,7 +86,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
dispatch(unreblog(status));
|
dispatch(unreblog(status));
|
||||||
} else {
|
} else {
|
||||||
if (e.shiftKey || !boostModal) {
|
if (e.shiftKey ^ !boostModal) {
|
||||||
this.onModalReblog(status);
|
this.onModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
|
||||||
|
|
|
@ -260,7 +260,7 @@ class Status extends ImmutablePureComponent {
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
this.props.dispatch(unreblog(status));
|
this.props.dispatch(unreblog(status));
|
||||||
} else {
|
} else {
|
||||||
if ((e && e.shiftKey) || !boostModal) {
|
if ((e && e.shiftKey) ^ !boostModal) {
|
||||||
this.handleModalReblog(status);
|
this.handleModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
this.props.dispatch(initBoostModal({ status, onReblog: this.handleModalReblog }));
|
this.props.dispatch(initBoostModal({ status, onReblog: this.handleModalReblog }));
|
||||||
|
|
Loading…
Reference in a new issue