mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(data-source): manager初始化数据源时,如果失败了要把data中对应的数据删掉,不然在ssr中会导致客户端不会重新尝试请求
This commit is contained in:
parent
054474634e
commit
fd80bada97
@ -76,8 +76,13 @@ class DataSourceManager extends EventEmitter {
|
|||||||
values.forEach((value, index) => {
|
values.forEach((value, index) => {
|
||||||
const dsId = dataSourceList[index][0];
|
const dsId = dataSourceList[index][0];
|
||||||
if (value.status === 'fulfilled') {
|
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') {
|
} else if (value.status === 'rejected') {
|
||||||
|
delete data[dsId];
|
||||||
errors[dsId] = value.reason;
|
errors[dsId] = value.reason;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user