]> cat aescling's git repositories - mastodon.git/blobdiff - app/javascript/mastodon/features/getting_started/index.js
Refactor initial state: "me" (#5563)
[mastodon.git] / app / javascript / mastodon / features / getting_started / index.js
index 973c8a4aef81e8ef7648c7101164234a94e0fd82..4b4ae6947038b96f17e4e8580a07e1a9dd7ebddf 100644 (file)
@@ -7,6 +7,7 @@ import { connect } from 'react-redux';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import ImmutablePureComponent from 'react-immutable-pure-component';
+import { me } from '../../initial_state';
 
 const messages = defineMessages({
   heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
@@ -27,7 +28,7 @@ const messages = defineMessages({
 });
 
 const mapStateToProps = state => ({
-  me: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
+  myAccount: state.getIn(['accounts', me]),
   columns: state.getIn(['settings', 'columns']),
 });
 
@@ -37,13 +38,13 @@ export default class GettingStarted extends ImmutablePureComponent {
 
   static propTypes = {
     intl: PropTypes.object.isRequired,
-    me: ImmutablePropTypes.map.isRequired,
+    myAccount: ImmutablePropTypes.map.isRequired,
     columns: ImmutablePropTypes.list,
     multiColumn: PropTypes.bool,
   };
 
   render () {
-    const { intl, me, columns, multiColumn } = this.props;
+    const { intl, myAccount, columns, multiColumn } = this.props;
 
     let navItems = [];
 
@@ -70,7 +71,7 @@ export default class GettingStarted extends ImmutablePureComponent {
       <ColumnLink key='5' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />,
     ]);
 
-    if (me.get('locked')) {
+    if (myAccount.get('locked')) {
       navItems.push(<ColumnLink key='6' icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />);
     }
 
This page took 0.051143 seconds and 3 git commands to generate.