From 9f526fdfa0189176b3d84a67afed4be0ce73c206 Mon Sep 17 00:00:00 2001 From: Edwin Fajardo <36389489+EdwinFajardoBarrera@users.noreply.github.com> Date: Wed, 22 Dec 2021 14:12:44 -0600 Subject: [PATCH] fix(ui): Exception when changing cluster on TopicList (#962) close ##835 --- client/src/containers/Connect/ConnectList/ConnectList.jsx | 6 ++++-- client/src/containers/Topic/TopicList/TopicList.jsx | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/containers/Connect/ConnectList/ConnectList.jsx b/client/src/containers/Connect/ConnectList/ConnectList.jsx index 8a20abfd9..a53d0eb1e 100644 --- a/client/src/containers/Connect/ConnectList/ConnectList.jsx +++ b/client/src/containers/Connect/ConnectList/ConnectList.jsx @@ -49,7 +49,7 @@ class ConnectList extends Root { const query = new URLSearchParams(this.props.location.search); this.setState({ searchData: { search: (query.get('search'))? query.get('search') : searchData.search }, - pageNumber: (query.get('page'))? parseInt(query.get('page')) : parseInt(pageNumber) + pageNumber: (query.get('page')) ? parseInt(query.get('page')) : parseInt(pageNumber) }, () => { this.getConnectDefinitions(); }); @@ -60,7 +60,9 @@ class ConnectList extends Root { this.cancelAxiosRequests(); this.renewCancelToken(); - this.componentDidMount(); + this.setState({ pageNumber: 1 }, () => { + this.componentDidMount(); + }); } } diff --git a/client/src/containers/Topic/TopicList/TopicList.jsx b/client/src/containers/Topic/TopicList/TopicList.jsx index be0d6f15c..321e86029 100644 --- a/client/src/containers/Topic/TopicList/TopicList.jsx +++ b/client/src/containers/Topic/TopicList/TopicList.jsx @@ -62,7 +62,9 @@ class TopicList extends Root { this.cancelAxiosRequests(); this.renewCancelToken(); - this._initializeVars(this.getTopics); + this.setState({ pageNumber: 1 }, () => { + this._initializeVars(this.getTopics); + }); } }