fix(editor): sentry-624432d8f1e6420ca9c5023a051f4332 (#9342)

Close https://toeverything.sentry.io/issues/6091618868/?project=4506307500179456
This commit is contained in:
doodlewind
2024-12-26 09:59:06 +00:00
parent d60e9a3885
commit 9b3a2fc0de

View File

@@ -230,14 +230,17 @@ export class MindmapElementModel extends GfxGroupLikeElementModel<MindmapElement
},
updateKey: boolean = true
) {
const collapsed = 'collapsed' in options;
const hasFromTo = 'to' in options;
const { connector, from, layout } = options;
if (!from.element || (!collapsed && !options.to.element)) {
if (!from?.element) {
return { outdated: true, cacheKey: '' };
}
if (hasFromTo && !options.to?.element) {
return { outdated: true, cacheKey: '' };
}
const cacheKey = collapsed
const cacheKey = !hasFromTo
? `${from.element.xywh}-collapsed-${layout}-${this.style}`
: `${from.element.xywh}-${options.to.element.xywh}-${layout}-${this.style}`;