Rename occurrences of `self` variable to `ownAccount`
This commit is contained in:
parent
ffbdfb5712
commit
58c142306d
|
@ -277,7 +277,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
_makeMenu = (publicStatus) => {
|
_makeMenu = (publicStatus) => {
|
||||||
const { status, intl, withDismiss, withGroupAdmin, me, isStaff, isAdmin } = this.props;
|
const { status, intl, withDismiss, withGroupAdmin, me, isStaff, isAdmin } = this.props;
|
||||||
const mutingConversation = status.get('muted');
|
const mutingConversation = status.get('muted');
|
||||||
const self = status.getIn(['account', 'id']) === me;
|
const ownAccount = status.getIn(['account', 'id']) === me;
|
||||||
|
|
||||||
let menu = [];
|
let menu = [];
|
||||||
|
|
||||||
|
@ -296,12 +296,12 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
|
|
||||||
menu.push(null);
|
menu.push(null);
|
||||||
|
|
||||||
if (self || withDismiss) {
|
if (ownAccount || withDismiss) {
|
||||||
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
|
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
|
||||||
menu.push(null);
|
menu.push(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self) {
|
if (ownAccount) {
|
||||||
if (publicStatus) {
|
if (publicStatus) {
|
||||||
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
|
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
|
||||||
} else {
|
} else {
|
||||||
|
@ -331,14 +331,14 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
|
|
||||||
menu.push({ text: intl.formatMessage(status.get('sensitive') === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), action: this.handleToggleStatusSensitivity });
|
menu.push({ text: intl.formatMessage(status.get('sensitive') === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), action: this.handleToggleStatusSensitivity });
|
||||||
|
|
||||||
if (!self) {
|
if (!ownAccount) {
|
||||||
menu.push({ text: intl.formatMessage(messages.deactivateUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeactivateUser });
|
menu.push({ text: intl.formatMessage(messages.deactivateUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeactivateUser });
|
||||||
menu.push({ text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeleteUser });
|
menu.push({ text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeleteUser });
|
||||||
menu.push({ text: intl.formatMessage(messages.deleteStatus), action: this.handleDeleteStatus });
|
menu.push({ text: intl.formatMessage(messages.deleteStatus), action: this.handleDeleteStatus });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!self && withGroupAdmin) {
|
if (!ownAccount && withGroupAdmin) {
|
||||||
menu.push(null);
|
menu.push(null);
|
||||||
menu.push({ text: intl.formatMessage(messages.group_remove_account), action: this.handleGroupRemoveAccount });
|
menu.push({ text: intl.formatMessage(messages.group_remove_account), action: this.handleGroupRemoveAccount });
|
||||||
menu.push({ text: intl.formatMessage(messages.group_remove_post), action: this.handleGroupRemovePost });
|
menu.push({ text: intl.formatMessage(messages.group_remove_post), action: this.handleGroupRemovePost });
|
||||||
|
|
|
@ -287,7 +287,7 @@ class Header extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const self = account.get('id') === me;
|
const ownAccount = account.get('id') === me;
|
||||||
const info = this.makeInfo();
|
const info = this.makeInfo();
|
||||||
const menu = this.makeMenu();
|
const menu = this.makeMenu();
|
||||||
|
|
||||||
|
@ -324,18 +324,18 @@ class Header extends ImmutablePureComponent {
|
||||||
<span><FormattedMessage id='account.posts' defaultMessage='Posts' /></span>
|
<span><FormattedMessage id='account.posts' defaultMessage='Posts' /></span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
|
||||||
{(self || !account.getIn(['pleroma', 'hide_follows'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/following`} title={intl.formatNumber(account.get('following_count'))}>
|
{(ownAccount || !account.getIn(['pleroma', 'hide_follows'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/following`} title={intl.formatNumber(account.get('following_count'))}>
|
||||||
{account.getIn(['pleroma', 'hide_follows_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('following_count'))}</span>}
|
{account.getIn(['pleroma', 'hide_follows_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('following_count'))}</span>}
|
||||||
<span><FormattedMessage id='account.follows' defaultMessage='Follows' /></span>
|
<span><FormattedMessage id='account.follows' defaultMessage='Follows' /></span>
|
||||||
</NavLink>}
|
</NavLink>}
|
||||||
|
|
||||||
{(self || !account.getIn(['pleroma', 'hide_followers'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/followers`} title={intl.formatNumber(account.get('followers_count'))}>
|
{(ownAccount || !account.getIn(['pleroma', 'hide_followers'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/followers`} title={intl.formatNumber(account.get('followers_count'))}>
|
||||||
{account.getIn(['pleroma', 'hide_followers_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('followers_count'))}</span>}
|
{account.getIn(['pleroma', 'hide_followers_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('followers_count'))}</span>}
|
||||||
<span><FormattedMessage id='account.followers' defaultMessage='Followers' /></span>
|
<span><FormattedMessage id='account.followers' defaultMessage='Followers' /></span>
|
||||||
</NavLink>}
|
</NavLink>}
|
||||||
|
|
||||||
{
|
{
|
||||||
self &&
|
ownAccount &&
|
||||||
<div>
|
<div>
|
||||||
<NavLink
|
<NavLink
|
||||||
exact activeClassName='active' to={`/@${account.get('acct')}/favorites`}
|
exact activeClassName='active' to={`/@${account.get('acct')}/favorites`}
|
||||||
|
|
|
@ -269,7 +269,7 @@ class ActionBar extends React.PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const { status, intl, me, isStaff, isAdmin, allowedEmoji } = this.props;
|
const { status, intl, me, isStaff, isAdmin, allowedEmoji } = this.props;
|
||||||
const { emojiSelectorVisible } = this.state;
|
const { emojiSelectorVisible } = this.state;
|
||||||
const self = status.getIn(['account', 'id']) === me;
|
const ownAccount = status.getIn(['account', 'id']) === me;
|
||||||
|
|
||||||
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
|
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
|
||||||
const mutingConversation = status.get('muted');
|
const mutingConversation = status.get('muted');
|
||||||
|
@ -294,7 +294,7 @@ class ActionBar extends React.PureComponent {
|
||||||
|
|
||||||
menu.push(null);
|
menu.push(null);
|
||||||
|
|
||||||
if (self) {
|
if (ownAccount) {
|
||||||
if (publicStatus) {
|
if (publicStatus) {
|
||||||
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
|
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
|
||||||
} else {
|
} else {
|
||||||
|
@ -327,7 +327,7 @@ class ActionBar extends React.PureComponent {
|
||||||
|
|
||||||
menu.push({ text: intl.formatMessage(status.get('sensitive') === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), action: this.handleToggleStatusSensitivity });
|
menu.push({ text: intl.formatMessage(status.get('sensitive') === false ? messages.markStatusSensitive : messages.markStatusNotSensitive), action: this.handleToggleStatusSensitivity });
|
||||||
|
|
||||||
if (!self) {
|
if (!ownAccount) {
|
||||||
menu.push({ text: intl.formatMessage(messages.deactivateUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeactivateUser });
|
menu.push({ text: intl.formatMessage(messages.deactivateUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeactivateUser });
|
||||||
menu.push({ text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeleteUser });
|
menu.push({ text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), action: this.handleDeleteUser });
|
||||||
menu.push({ text: intl.formatMessage(messages.deleteStatus), action: this.handleDeleteStatus });
|
menu.push({ text: intl.formatMessage(messages.deleteStatus), action: this.handleDeleteStatus });
|
||||||
|
|
Loading…
Reference in New Issue