From 7662ae6a091fec26a91e5739fd5252f41e263e1c Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Tue, 26 Sep 2023 12:59:55 +0800 Subject: [PATCH] fix: fix request twice fix request twice when change the menu Change-Id: I8f3262f6fcaacb20a82bb82636d9ccfce921c064 --- src/containers/List/index.jsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index 9bec2ed6..1150c063 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -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); }