From 08290b0b0270f0755be50f3e57622e499813dc67 Mon Sep 17 00:00:00 2001 From: David Yip Date: Wed, 6 Dec 2017 18:23:28 -0600 Subject: [PATCH] Apply Javascript changes in tootsuite/mastodon#5887 to glitch flavour (#239) --- app/javascript/flavours/glitch/components/account.js | 4 ++-- .../glitch/features/account/components/action_bar.js | 5 ++--- .../features/account_timeline/containers/header_container.js | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js index c8dacb0ab9..ac07051db9 100644 --- a/app/javascript/flavours/glitch/components/account.js +++ b/app/javascript/flavours/glitch/components/account.js @@ -81,7 +81,7 @@ export default class Account extends ImmutablePureComponent { buttons = ; } else if (muting) { let hidingNotificationsButton; - if (muting.get('notifications')) { + if (account.getIn(['relationship', 'muting_notifications'])) { hidingNotificationsButton = ; } else { hidingNotificationsButton = ; @@ -93,7 +93,7 @@ export default class Account extends ImmutablePureComponent { ); } else { - buttons = ; + buttons = ; } } diff --git a/app/javascript/flavours/glitch/features/account/components/action_bar.js b/app/javascript/flavours/glitch/features/account/components/action_bar.js index 7c9c1af4e8..df8cb37337 100644 --- a/app/javascript/flavours/glitch/features/account/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/account/components/action_bar.js @@ -63,9 +63,8 @@ export default class ActionBar extends React.PureComponent { if (account.get('id') === me) { menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' }); } else { - const following = account.getIn(['relationship', 'following']); - if (following) { - if (following.get('reblogs')) { + if (account.getIn(['relationship', 'following'])) { + if (account.getIn(['relationship', 'showing_reblogs'])) { menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle }); } else { menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle }); diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js index 815a1a6136..9c0557f028 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js @@ -68,7 +68,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }, onReblogToggle (account) { - if (account.getIn(['relationship', 'following', 'reblogs'])) { + if (account.getIn(['relationship', 'show_reblogs'])) { dispatch(followAccount(account.get('id'), false)); } else { dispatch(followAccount(account.get('id'), true));