优化 api 检测

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

View File

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

View File

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

View File

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