fix: 调整冗余代码

This commit is contained in:
fujianchao 2024-11-04 16:28:25 +08:00 committed by lmaomaoz
parent 6bb19a2e9e
commit e41f8d9ade
2 changed files with 1 additions and 7 deletions

View File

@ -354,7 +354,7 @@ export function withRemoteConfig<P = any>(
} else {
store.setConfig(source, config, 'syncConfig');
}
} else if (isObject(source) && !isEffectiveApi(source, data)) {
} else if (isObject(source) && !source.method) {
store.setConfig(source, config, 'syncConfig');
}
}

View File

@ -201,12 +201,6 @@ const TimelineWithRemoteConfig = withRemoteConfig({
class extends React.Component<
RemoteOptionsProps & React.ComponentProps<typeof TimelineCmpt>
> {
componentDidMount() {
const {source, updateConfig, config} = this.props;
if (typeof source === 'object' && !source.url && config) {
updateConfig(undefined);
}
}
componentDidUpdate(prevProps: any) {
const {source, updateConfig, config} = this.props;
// 当source为空时需要重置config