Commit bfe13935 authored by jljsj's avatar jljsj

fix #1215

parent 558f73b6
......@@ -6,7 +6,7 @@ import { connect } from 'dva';
import { Route, Redirect, Switch, routerRedux } from 'dva/router';
import { ContainerQuery } from 'react-container-query';
import classNames from 'classnames';
import { enquireScreen } from 'enquire-js';
import { enquireScreen, unenquireScreen } from 'enquire-js';
import GlobalHeader from '../components/GlobalHeader';
import GlobalFooter from '../components/GlobalFooter';
import SiderMenu from '../components/SiderMenu';
......@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent {
};
}
componentDidMount() {
enquireScreen(mobile => {
this.enquireHandler = enquireScreen(mobile => {
this.setState({
isMobile: mobile,
});
......@@ -108,6 +108,9 @@ class BasicLayout extends React.PureComponent {
type: 'user/fetchCurrent',
});
}
componentWillUnmount(){
unenquireScreen(this.enquireHandler);
}
getPageTitle() {
const { routerData, location } = this.props;
const { pathname } = location;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment