Skip to content

Commit

Permalink
fix(ui): clicking on Empty Topic button display blank screen (#1429)
Browse files Browse the repository at this point in the history
close #912

Co-authored-by: Olivier <oghizzo@xebia.fr>
  • Loading branch information
mawguai and Olivier authored Mar 18, 2023
1 parent a773a4b commit 1f85d80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions client/src/containers/Topic/Topic/Topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ class Topic extends Root {
canEmptyTopic = () => {
const { configs } = this.state;
const res = configs.filter(config => config.name === 'cleanup.policy');
if (res && res.length === 1 && res[0].value.includes('delete')) return true;
return false;
return res && res.length === 1 && res[0].value.includes('delete');
};

emptyTopic = () => {
Expand All @@ -95,7 +94,7 @@ class Topic extends Root {
.then(() => {
toast.success(`Topic '${topicId}' will be emptied`);
this.setState({ showDeleteModal: false }, () => {
this.topicData.current.getMessages();
this.topicData.current._getMessages(false);
});
})
.catch(() => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class TopicData extends Root {
this._fetchMessages(requests);
}

_getMessages(changePage = false) {
_getMessages = changePage => {
const { selectedCluster, selectedTopic, nextPage } = this.state;

const filters = this._buildFilters();
Expand All @@ -315,7 +315,7 @@ class TopicData extends Root {
} else {
this._setUrlHistory(filters);
}
}
};

_fetchMessages(requests, changePage = false) {
const { nextPage, pageNumber, partitionCount, recordCount, offsets } = this.state;
Expand Down

0 comments on commit 1f85d80

Please sign in to comment.