File tree Expand file tree Collapse file tree
src/common/categories/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,13 @@ export function findCategoryConfig<V extends VIEW_KIND>(
1313 viewKind : V ,
1414 key : Category [ "key" ] ,
1515 configs : CategoryConfig [ ]
16- ) : Extract < CategoryConfig , { viewKind : V } > | undefined {
16+ ) : Extract < CategoryConfig , { viewKind ? : V } > | undefined {
1717 return configs . find (
18- ( c ) : c is Extract < CategoryConfig , { viewKind : V } > =>
19- c . viewKind === viewKind && c . key === key
18+ ( c ) : c is Extract < CategoryConfig , { viewKind ?: V } > =>
19+ // When `viewKind` is undefined, it corresponds to a `SelectCategoryConfig`.
20+ // This predicate ensures that `viewKind` is either explicitly matched or treated as undefined
21+ // for compatibility with `SelectCategoryConfig` and other explicitly defined view kinds.
22+ ( c . viewKind === undefined || c . viewKind === viewKind ) && c . key === key
2023 ) ;
2124}
2225
You can’t perform that action at this time.
0 commit comments