stale的判定改回component级

This commit is contained in:
Xu Chang 2025-01-03 11:42:26 +08:00
parent 1796849f96
commit b404ad5faf
3 changed files with 8 additions and 5 deletions

View File

@ -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",

View File

@ -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();

View File

@ -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 {