Skip to content

Commit

Permalink
fix: 合并检查api的if逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
F-jianchao authored and CheshireJCat committed Nov 4, 2024
1 parent 61f9fda commit 82efeba
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/amis/src/renderers/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,10 @@ export class TimelineRenderer extends React.Component<TimelineProps> {
if (this.remoteRef && source !== prevProps.source) {
// 如果是变量,则同步配置。如果为api,则重新加载配置
(isPureVariable(source) && this.remoteRef.syncConfig()) ||
(isEffectiveApi(source, data) &&
(source as ApiObject).autoRefresh !== false &&
this.remoteRef.loadConfig());
// 如果source为空,则清空配置
if (!source || (typeof source === 'object' && !source.url)) {
this.remoteRef.setConfig(undefined);
}
(isEffectiveApi(source, data)
? (source as ApiObject).autoRefresh !== false &&
this.remoteRef.loadConfig()
: this.remoteRef.setConfig(undefined));
}
}

Expand Down

0 comments on commit 82efeba

Please sign in to comment.