From 2ea9b164d315cedd98618b8b9626c2a2bec3ff36 Mon Sep 17 00:00:00 2001 From: Surinna Curtis Date: Sun, 6 Aug 2017 20:00:38 -0300 Subject: [PATCH] Satisfy eslint. --- .../glitch/components/status/container.js | 5 +-- .../containers/header_container.js | 1 - .../features/ui/components/mute_modal.js | 9 +++-- app/javascript/mastodon/reducers/mutes.js | 38 +++++++++---------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/app/javascript/glitch/components/status/container.js b/app/javascript/glitch/components/status/container.js index 6e49081b70..b4d7fb4cc4 100644 --- a/app/javascript/glitch/components/status/container.js +++ b/app/javascript/glitch/components/status/container.js @@ -39,10 +39,7 @@ import { unreblog, unfavourite, } from '../../../mastodon/actions/interactions'; -import { - blockAccount, - muteAccount, -} from '../../../mastodon/actions/accounts'; +import { blockAccount } from '../../../mastodon/actions/accounts'; import { initMuteModal } from '../../../mastodon/actions/mutes'; import { muteStatus, diff --git a/app/javascript/mastodon/features/account_timeline/containers/header_container.js b/app/javascript/mastodon/features/account_timeline/containers/header_container.js index 3f521f0483..ac1364441c 100644 --- a/app/javascript/mastodon/features/account_timeline/containers/header_container.js +++ b/app/javascript/mastodon/features/account_timeline/containers/header_container.js @@ -7,7 +7,6 @@ import { unfollowAccount, blockAccount, unblockAccount, - muteAccount, unmuteAccount, } from '../../../actions/accounts'; import { mentionCompose } from '../../../actions/compose'; diff --git a/app/javascript/mastodon/features/ui/components/mute_modal.js b/app/javascript/mastodon/features/ui/components/mute_modal.js index 51a2d70e05..0f3bcb7082 100644 --- a/app/javascript/mastodon/features/ui/components/mute_modal.js +++ b/app/javascript/mastodon/features/ui/components/mute_modal.js @@ -19,7 +19,7 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { onConfirm(account, notifications) { - dispatch(muteAccount(account.get('id'), notifications)) + dispatch(muteAccount(account.get('id'), notifications)); }, onClose() { @@ -35,6 +35,7 @@ const mapDispatchToProps = dispatch => { @connect(mapStateToProps, mapDispatchToProps) @injectIntl export default class MuteModal extends React.PureComponent { + static propTypes = { isSubmitting: PropTypes.bool.isRequired, account: PropTypes.object.isRequired, @@ -73,14 +74,15 @@ export default class MuteModal extends React.PureComponent {

- @{account.get('acct')} }} />

- +

@@ -95,4 +97,5 @@ export default class MuteModal extends React.PureComponent {
); } + } \ No newline at end of file diff --git a/app/javascript/mastodon/reducers/mutes.js b/app/javascript/mastodon/reducers/mutes.js index 6d6a9a3b8d..400a7c4234 100644 --- a/app/javascript/mastodon/reducers/mutes.js +++ b/app/javascript/mastodon/reducers/mutes.js @@ -1,29 +1,29 @@ import Immutable from 'immutable'; import { - MUTES_INIT_MODAL, - MUTES_TOGGLE_HIDE_NOTIFICATIONS, + MUTES_INIT_MODAL, + MUTES_TOGGLE_HIDE_NOTIFICATIONS, } from '../actions/mutes'; const initialState = Immutable.Map({ - new: Immutable.Map({ - isSubmitting: false, - account: null, - notifications: true, - }), + new: Immutable.Map({ + isSubmitting: false, + account: null, + notifications: true, + }), }); export default function mutes(state = initialState, action) { - switch (action.type) { - case MUTES_INIT_MODAL: - return state.withMutations((state) => { - state.setIn(['new', 'isSubmitting'], false); - state.setIn(['new', 'account'], action.account); - state.setIn(['new', 'notifications'], true); - }); - case MUTES_TOGGLE_HIDE_NOTIFICATIONS: - return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications'])); - default: - return state; - } + switch (action.type) { + case MUTES_INIT_MODAL: + return state.withMutations((state) => { + state.setIn(['new', 'isSubmitting'], false); + state.setIn(['new', 'account'], action.account); + state.setIn(['new', 'notifications'], true); + }); + case MUTES_TOGGLE_HIDE_NOTIFICATIONS: + return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications'])); + default: + return state; + } } \ No newline at end of file