Skip to content

Commit

Permalink
fix(data-source): manager初始化数据源时,如果失败了要把data中对应的数据删掉,不然在ssr中会导致客户端不会重…
Browse files Browse the repository at this point in the history
…新尝试请求
  • Loading branch information
roymondchen authored and jia000 committed Dec 9, 2024
1 parent 0544746 commit fd80bad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/data-source/src/DataSourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ class DataSourceManager extends EventEmitter {
values.forEach((value, index) => {
const dsId = dataSourceList[index][0];
if (value.status === 'fulfilled') {
data[dsId] = this.data[dsId];
if (this.data[dsId]) {
data[dsId] = this.data[dsId];
} else {
delete data[dsId];
}
} else if (value.status === 'rejected') {
delete data[dsId];
errors[dsId] = value.reason;
}
});
Expand Down

0 comments on commit fd80bad

Please sign in to comment.