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