From 8d6447090474d1a38e50e9477ea3ec575915adda Mon Sep 17 00:00:00 2001 From: Nut He <18328704+hetao92@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:09:57 +0800 Subject: [PATCH] fix: fix import map (#173) --- app/stores/import.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/stores/import.ts b/app/stores/import.ts index 321c6288..0fe28946 100644 --- a/app/stores/import.ts +++ b/app/stores/import.ts @@ -263,8 +263,10 @@ export class ImportStore { const tags = this.verticesConfig[configIndex].tags; tags.splice(tagIndex, 1); } else { - const tag = this.verticesConfig[configIndex].tags[tagIndex]; - tag.props[propIndex][field!] = value; + const tags = this.verticesConfig[configIndex].tags; + const _tag = { ...tags[tagIndex] }; + _tag.props[propIndex][field!] = value; + tags.splice(tagIndex, 1, _tag); } } @@ -279,7 +281,9 @@ export class ImportStore { this.edgesConfig[configIndex].type = ''; this.edgesConfig[configIndex].props = []; } else { - this.edgesConfig[configIndex].props[propIndex][field] = value; + const _edge = { ...this.edgesConfig[configIndex] }; + _edge.props[propIndex][field] = value; + this.edgesConfig[configIndex] = _edge; } } }