Apply Javascript changes in tootsuite/mastodon#5887 to glitch flavour (#239)

master
David Yip 7 years ago
parent 061211a1e3
commit 133f5b3b53
No known key found for this signature in database
GPG Key ID: 7DA0036508FCC0CC
  1. 4
      app/javascript/flavours/glitch/components/account.js
  2. 5
      app/javascript/flavours/glitch/features/account/components/action_bar.js
  3. 2
      app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js

@ -81,7 +81,7 @@ export default class Account extends ImmutablePureComponent {
buttons = <IconButton active icon='unlock-alt' title={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.handleBlock} />; buttons = <IconButton active icon='unlock-alt' title={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.handleBlock} />;
} else if (muting) { } else if (muting) {
let hidingNotificationsButton; let hidingNotificationsButton;
if (muting.get('notifications')) { if (account.getIn(['relationship', 'muting_notifications'])) {
hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.unmute_notifications, { name: account.get('username') })} onClick={this.handleUnmuteNotifications} />; hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.unmute_notifications, { name: account.get('username') })} onClick={this.handleUnmuteNotifications} />;
} else { } else {
hidingNotificationsButton = <IconButton active icon='bell-slash' title={intl.formatMessage(messages.mute_notifications, { name: account.get('username') })} onClick={this.handleMuteNotifications} />; hidingNotificationsButton = <IconButton active icon='bell-slash' title={intl.formatMessage(messages.mute_notifications, { name: account.get('username') })} onClick={this.handleMuteNotifications} />;
@ -93,7 +93,7 @@ export default class Account extends ImmutablePureComponent {
</div> </div>
); );
} else { } else {
buttons = <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(following ? messages.unfollow : messages.follow)} onClick={this.handleFollow} active={following ? true : false} />; buttons = <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(following ? messages.unfollow : messages.follow)} onClick={this.handleFollow} active={following} />;
} }
} }

@ -63,9 +63,8 @@ export default class ActionBar extends React.PureComponent {
if (account.get('id') === me) { if (account.get('id') === me) {
menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' }); menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });
} else { } else {
const following = account.getIn(['relationship', 'following']); if (account.getIn(['relationship', 'following'])) {
if (following) { if (account.getIn(['relationship', 'showing_reblogs'])) {
if (following.get('reblogs')) {
menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle }); menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });
} else { } else {
menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle }); menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });

@ -68,7 +68,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}, },
onReblogToggle (account) { onReblogToggle (account) {
if (account.getIn(['relationship', 'following', 'reblogs'])) { if (account.getIn(['relationship', 'show_reblogs'])) {
dispatch(followAccount(account.get('id'), false)); dispatch(followAccount(account.get('id'), false));
} else { } else {
dispatch(followAccount(account.get('id'), true)); dispatch(followAccount(account.get('id'), true));

Loading…
Cancel
Save