stale的判定改回component级
This commit is contained in:
parent
1796849f96
commit
b404ad5faf
|
|
@ -64,7 +64,7 @@
|
|||
"@types/node": "^20.7.0",
|
||||
"@types/node-schedule": "^2.1.0",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/react": "^18.3.17",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.2.14",
|
||||
"@types/react-native": "^0.72.8",
|
||||
"@types/uuid": "^9.0.6",
|
||||
|
|
|
|||
|
|
@ -2554,11 +2554,14 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
|
|||
return node ? node.isExecuting() : false;
|
||||
}
|
||||
|
||||
isListDescandentOrStaleBranch(path: string) {
|
||||
isListDescandentOrStale(path: string) {
|
||||
const node = this.findNode(path);
|
||||
if (node?.isStale()) {
|
||||
return true;
|
||||
}
|
||||
let parent = node?.getParent();
|
||||
while (parent) {
|
||||
if (parent instanceof ListNode || parent.isStale()) {
|
||||
if (parent instanceof ListNode) {
|
||||
return true;
|
||||
}
|
||||
parent = parent.getParent();
|
||||
|
|
|
|||
|
|
@ -979,7 +979,7 @@ export function createComponent<
|
|||
|
||||
try {
|
||||
const { oakFullpath } = this.state;
|
||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||
await this.refresh();
|
||||
}
|
||||
else {
|
||||
|
|
@ -1047,7 +1047,7 @@ export function createComponent<
|
|||
lifetimes?.show && lifetimes.show.call(this);
|
||||
}
|
||||
const { oakFullpath } = this.state;
|
||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||
this.refresh();
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue