isCreation的bug
This commit is contained in:
parent
a15a03cabd
commit
1c42b405ec
|
|
@ -443,13 +443,10 @@ const oakBehavior = Behavior({
|
|||
return this.features.runningTree.remove(path2);
|
||||
},
|
||||
isCreation(path) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
assert(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ === 1;
|
||||
},
|
||||
async aggregate(aggregation) {
|
||||
return await this.features.cache.aggregate(this.state.oakEntity, aggregation);
|
||||
|
|
|
|||
|
|
@ -144,13 +144,9 @@ class OakComponentBase extends React.PureComponent {
|
|||
this.features.runningTree.remove(path2);
|
||||
}
|
||||
isCreation(path) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
assert(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ === 1;
|
||||
}
|
||||
clean(lsn, dontPublish, path) {
|
||||
const path2 = path
|
||||
|
|
|
|||
|
|
@ -446,13 +446,10 @@ const oakBehavior = Behavior({
|
|||
return this.features.runningTree.remove(path2);
|
||||
},
|
||||
isCreation(path) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
(0, assert_1.assert)(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ === 1;
|
||||
},
|
||||
async aggregate(aggregation) {
|
||||
return await this.features.cache.aggregate(this.state.oakEntity, aggregation);
|
||||
|
|
|
|||
|
|
@ -149,13 +149,9 @@ class OakComponentBase extends react_1.default.PureComponent {
|
|||
this.features.runningTree.remove(path2);
|
||||
}
|
||||
isCreation(path) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
(0, assert_1.assert)(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ === 1;
|
||||
}
|
||||
clean(lsn, dontPublish, path) {
|
||||
const path2 = path
|
||||
|
|
|
|||
|
|
@ -653,14 +653,11 @@ const oakBehavior = Behavior<
|
|||
},
|
||||
|
||||
isCreation(path) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
|
||||
assert(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ as number === 1;
|
||||
},
|
||||
|
||||
async aggregate(aggregation) {
|
||||
|
|
|
|||
|
|
@ -303,14 +303,10 @@ abstract class OakComponentBase<
|
|||
}
|
||||
|
||||
isCreation(path?: string) {
|
||||
const path2 = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
// 调用getFreshValue,不redo的情况下如果是creation返回应当是空
|
||||
const value = this.getFreshValue(path2);
|
||||
const value = this.getFreshValue(path);
|
||||
|
||||
assert(!(value instanceof Array));
|
||||
return !value;
|
||||
return value?.$$createAt$$ as number === 1;
|
||||
}
|
||||
|
||||
clean(lsn?: number, dontPublish?: true, path?: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue