Skip to content

Commit

Permalink
🐛 修复标签删除后还在面板中的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlefean committed Nov 29, 2024
1 parent 094130d commit 3313e33
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/stage/stageManager/StageManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ export namespace StageManager {
export function getTagUUIDs(): string[] {
return tags.valuesToArray();
}
// 清理未引用的标签
export function updateTags() {
const uuids = tags.valuesToArray();
for (const uuid of uuids) {
if (!entities.hasId(uuid)) {
tags.deleteValue(uuid);
}
}
}
}

/**
Expand Down Expand Up @@ -242,6 +251,8 @@ export namespace StageManager {
}
edge.isShifting = isShifting;
}
// 对tags进行更新
TagOptions.updateTags();
}

export function getTextNodeByUUID(uuid: string): TextNode | null {
Expand Down

0 comments on commit 3313e33

Please sign in to comment.