0
0
Fork 0

Refactor initial state: "me" (#5563)

* Refactor initial state: "me"

* remove "me" from reducers/meta.js
This commit is contained in:
Nolan Lawson 2017-10-30 19:27:48 -07:00 committed by Yamagishi Kazutoshi
parent 29609fbb6a
commit b254e6ca5f
24 changed files with 44 additions and 60 deletions

View file

@ -22,7 +22,6 @@ const mapStateToProps = state => ({
preselectDate: state.getIn(['compose', 'preselectDate']),
is_submitting: state.getIn(['compose', 'is_submitting']),
is_uploading: state.getIn(['compose', 'is_uploading']),
me: state.getIn(['compose', 'me']),
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
});

View file

@ -1,9 +1,10 @@
import { connect } from 'react-redux';
import NavigationBar from '../components/navigation_bar';
import { me } from '../../../initial_state';
const mapStateToProps = state => {
return {
account: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
account: state.getIn(['accounts', me]),
};
};

View file

@ -3,9 +3,10 @@ import { connect } from 'react-redux';
import Warning from '../components/warning';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { me } from '../../../initial_state';
const mapStateToProps = state => ({
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', state.getIn(['meta', 'me']), 'locked']),
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),
});
const WarningWrapper = ({ needsLockWarning }) => {