优化 api 检测

This commit is contained in:
catchonme 2019-07-15 12:20:47 +08:00
parent 651b29f605
commit ed5948d76d
3 changed files with 3 additions and 7 deletions

View File

@ -124,11 +124,7 @@ export class Chart extends React.Component<ChartProps> {
if (query) {
return this.receive(query);
} else if (!env || !env.fetcher || !api) {
return;
}
if (!isEffectiveApi(api, store.data)) {
} else if (!env || !env.fetcher || !isEffectiveApi(api, store.data)) {
return;
}

View File

@ -102,7 +102,7 @@ export default class ChainedSelectControl extends React.Component<ChainedSelectP
stack
}, () => {
env
.fetcher(source, {
.fetcher(source as Api, {
...data,
value: arr,
level: idx + 1,

View File

@ -120,7 +120,7 @@ export default class Navigation extends React.Component<NavigationProps, Navigat
return;
}
env.fetcher(source, finalData)
env.fetcher(source as Api, finalData)
.then(payload => {
if (!this.mounted) {
return;