mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
删除不必要的isEffctiveApi
This commit is contained in:
parent
2f39ea2148
commit
85b38a2016
@ -272,10 +272,7 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
const props = this.props;
|
||||
const store = props.store;
|
||||
|
||||
if (
|
||||
isApiOutdated(prevProps.initApi, props.initApi, prevProps.data, props.data) &&
|
||||
isEffectiveApi(props.initApi, props.data)
|
||||
) {
|
||||
if (isApiOutdated(prevProps.initApi, props.initApi, prevProps.data, props.data)) {
|
||||
const {
|
||||
fetchSuccess,
|
||||
fetchFailed,
|
||||
|
@ -88,19 +88,17 @@ export default class Service extends React.Component<ServiceProps> {
|
||||
}
|
||||
} = props;
|
||||
|
||||
isApiOutdated(prevProps.api, props.api, prevProps.data, props.data) &&
|
||||
isEffectiveApi(props.api, props.data) &&
|
||||
store.fetchData(props.api as Api, store.data, {
|
||||
isApiOutdated(prevProps.api, props.api, prevProps.data, props.data)
|
||||
store.fetchData(props.api as Api, store.data, {
|
||||
successMessage: fetchSuccess,
|
||||
errorMessage: fetchFailed
|
||||
}).then(this.initInterval);
|
||||
|
||||
isApiOutdated(prevProps.schemaApi, props.schemaApi, prevProps.data, props.data) &&
|
||||
store.fetchSchema(props.schemaApi as Api, store.data, {
|
||||
successMessage: fetchSuccess,
|
||||
errorMessage: fetchFailed
|
||||
}).then(this.initInterval);
|
||||
|
||||
isApiOutdated(prevProps.schemaApi, props.schemaApi, prevProps.data, props.data) &&
|
||||
isEffectiveApi(props.schemaApi, props.data) &&
|
||||
store.fetchSchema(props.schemaApi as Api, store.data, {
|
||||
successMessage: fetchSuccess,
|
||||
errorMessage: fetchFailed
|
||||
}).then(this.initInterval);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -146,10 +146,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
||||
const props = this.props;
|
||||
const {store, fetchSuccess, fetchFailed} = props;
|
||||
|
||||
if (
|
||||
isApiOutdated(prevProps.initApi, props.initApi, prevProps.data, props.data) &&
|
||||
isEffectiveApi(props.initApi, props.data)
|
||||
) {
|
||||
if (isApiOutdated(prevProps.initApi, props.initApi, prevProps.data, props.data)) {
|
||||
store.fetchData(props.initApi, store.data, {
|
||||
successMessage: fetchSuccess,
|
||||
errorMessage: fetchFailed,
|
||||
|
Loading…
Reference in New Issue
Block a user