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(
|
export const getTopicByName = createSelector(
|
||||||
getTopicMap,
|
getTopicMap,
|
||||||
getTopicName,
|
getTopicName,
|
||||||
(topics, topicName) => topics[topicName]
|
(topics, topicName) => topics[topicName] || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getPartitionsByTopicName = createSelector(
|
export const getPartitionsByTopicName = createSelector(
|
||||||
|
@ -201,9 +201,8 @@ export const getIsTopicInternal = createSelector(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getTopicConsumerGroups = createSelector(
|
export const getTopicConsumerGroups = createSelector(
|
||||||
getTopicMap,
|
getTopicByName,
|
||||||
getTopicName,
|
({ consumerGroups }) => consumerGroups || []
|
||||||
(topics, topicName) => topics[topicName].consumerGroups || []
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMessageSchemaByTopicName = createSelector(
|
export const getMessageSchemaByTopicName = createSelector(
|
||||||
|
|
Loading…
Add table
Reference in a new issue