fix: fix request twice

fix request twice when change the menu

Change-Id: I8f3262f6fcaacb20a82bb82636d9ccfce921c064
This commit is contained in:
Jingwei.Zhang 2023-09-26 12:59:55 +08:00
parent b1f8c82010
commit 7662ae6a09

View File

@ -80,19 +80,12 @@ export default class BaseList extends React.Component {
}
componentDidMount() {
this.unsubscribe = this.routing.history.subscribe((location) => {
if (
location.pathname === this.props.match.url &&
location.key === this.props.location.key
) {
const params = this.initFilter;
if (!this.filterTimeKey) {
const { limit, page } = this.store.list;
this.list.filters = {};
this.handleFetch({ ...params, limit, page }, true);
}
}
});
const params = this.initFilter;
if (!this.filterTimeKey) {
const { limit, page } = this.store.list;
this.list.filters = {};
this.handleFetch({ ...params, limit, page }, true);
}
window.addEventListener('resize', this.debounceSetTableHeight);
}