Fix Selectors to not give error if not fetched yet (#2075)
This commit is contained in:
parent
89c409a5d6
commit
c42858e722
1 changed files with 3 additions and 4 deletions
|
@ -138,7 +138,7 @@ const getTopicName = (_: RootState, topicName: TopicName) => topicName;
|
|||
export const getTopicByName = createSelector(
|
||||
getTopicMap,
|
||||
getTopicName,
|
||||
(topics, topicName) => topics[topicName]
|
||||
(topics, topicName) => topics[topicName] || {}
|
||||
);
|
||||
|
||||
export const getPartitionsByTopicName = createSelector(
|
||||
|
@ -201,9 +201,8 @@ export const getIsTopicInternal = createSelector(
|
|||
);
|
||||
|
||||
export const getTopicConsumerGroups = createSelector(
|
||||
getTopicMap,
|
||||
getTopicName,
|
||||
(topics, topicName) => topics[topicName].consumerGroups || []
|
||||
getTopicByName,
|
||||
({ consumerGroups }) => consumerGroups || []
|
||||
);
|
||||
|
||||
export const getMessageSchemaByTopicName = createSelector(
|
||||
|
|
Loading…
Add table
Reference in a new issue