@@ -26,20 +26,21 @@ import {TopicInfo} from './TopicInfo';
26
26
interface OverviewProps {
27
27
type ?: EPathType ;
28
28
path : string ;
29
+ database : string ;
29
30
}
30
31
31
- function Overview ( { type, path} : OverviewProps ) {
32
+ function Overview ( { type, path, database } : OverviewProps ) {
32
33
const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
33
34
34
35
const isEntityWithMergedImpl = isEntityWithMergedImplementation ( type ) ;
35
36
36
37
// shallowEqual prevents rerenders when new schema data is loaded
37
38
const mergedChildrenPaths = useTypedSelector (
38
- ( state ) => selectSchemaMergedChildrenPaths ( state , path , type ) ,
39
+ ( state ) => selectSchemaMergedChildrenPaths ( state , path , type , database ) ,
39
40
shallowEqual ,
40
41
) ;
41
42
42
- let paths : string [ ] | typeof skipToken = skipToken ;
43
+ let paths : string [ ] = [ ] ;
43
44
if ( ! isEntityWithMergedImpl ) {
44
45
paths = [ path ] ;
45
46
} else if ( mergedChildrenPaths ) {
@@ -50,13 +51,13 @@ function Overview({type, path}: OverviewProps) {
50
51
currentData,
51
52
isFetching,
52
53
error : overviewError ,
53
- } = overviewApi . useGetOverviewQuery ( paths , {
54
+ } = overviewApi . useGetOverviewQuery ( paths . length ? { paths , database } : skipToken , {
54
55
pollingInterval : autoRefreshInterval ,
55
56
} ) ;
56
57
const overviewLoading = isFetching && currentData === undefined ;
57
58
const { data : rawData , additionalData} = currentData || { } ;
58
59
59
- const { error : schemaError } = useGetSchemaQuery ( { path} ) ;
60
+ const { error : schemaError } = useGetSchemaQuery ( { path, database } ) ;
60
61
61
62
const entityLoading = overviewLoading ;
62
63
const entityNotReady = isEntityWithMergedImpl && ! mergedChildrenPaths ;
0 commit comments