Browse Source

fix #1532 menu select bug

pull/1622/head
jim 8 years ago
parent
commit
6e3422fef3
  1. 9
      src/routes/Account/Settings/Info.js

9
src/routes/Account/Settings/Info.js

@ -19,6 +19,15 @@ const menuMap = {
currentUser: user.currentUser,
}))
export default class Info extends Component {
static getDerivedStateFromProps(props, state) {
const { match, location } = props;
let selectKey = location.pathname.replace(`${match.path}/`, '');
selectKey = menuMap[selectKey] ? selectKey : 'base';
if (selectKey !== state.selectKey) {
return { selectKey };
}
return null;
}
constructor(props) {
super(props);
const { match, location } = props;

Loading…
Cancel
Save