小程序的oakId变化不能用prevState加以判定
This commit is contained in:
parent
c354998fb8
commit
93fe02d680
|
|
@ -521,14 +521,13 @@ const oakBehavior = Behavior({
|
|||
// 在init状态小程序也可能会调这个observer,先忽略之
|
||||
return;
|
||||
}
|
||||
if (data !== this.prevState.oakId) {
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(this.state.oakFullpath, data);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
// oakId是props,不能用prevState来追踪其前期
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(this.state.oakFullpath, data);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -524,14 +524,13 @@ const oakBehavior = Behavior({
|
|||
// 在init状态小程序也可能会调这个observer,先忽略之
|
||||
return;
|
||||
}
|
||||
if (data !== this.prevState.oakId) {
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(this.state.oakFullpath, data);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
// oakId是props,不能用prevState来追踪其前期
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(this.state.oakFullpath, data);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -745,17 +745,16 @@ const oakBehavior = Behavior<
|
|||
// 在init状态小程序也可能会调这个observer,先忽略之
|
||||
return;
|
||||
}
|
||||
if (data !== this.prevState.oakId) {
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(
|
||||
this.state.oakFullpath,
|
||||
data
|
||||
);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
// bugfixed: oakId是props,不能用prevState来追踪其前项值
|
||||
if (this.state.oakFullpath) {
|
||||
if (data) {
|
||||
this.features.runningTree.setId(
|
||||
this.state.oakFullpath,
|
||||
data
|
||||
);
|
||||
}
|
||||
else {
|
||||
this.features.runningTree.unsetId(this.state.oakFullpath);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue