rework 4df35b82: clear the different style's id
This commit is contained in:
parent
4df35b829b
commit
449f86e5ef
|
@ -102,10 +102,18 @@ function importFromString(jsonString) {
|
||||||
item.name = item.name.trim();
|
item.name = item.name.trim();
|
||||||
const byId = BG.cachedStyles.byId.get(item.id);
|
const byId = BG.cachedStyles.byId.get(item.id);
|
||||||
const byName = oldStylesByName.get(item.name);
|
const byName = oldStylesByName.get(item.name);
|
||||||
const oldStyle = byId && sameStyle(byId, item) ? byId : byName;
|
|
||||||
oldStylesByName.delete(item.name);
|
oldStylesByName.delete(item.name);
|
||||||
if (oldStyle == byName && byName) {
|
let oldStyle;
|
||||||
|
if (byId) {
|
||||||
|
if (sameStyle(byId, item)) {
|
||||||
|
oldStyle = byId;
|
||||||
|
} else {
|
||||||
|
item.id = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!oldStyle && byName) {
|
||||||
item.id = byName.id;
|
item.id = byName.id;
|
||||||
|
oldStyle = byName;
|
||||||
}
|
}
|
||||||
const oldStyleKeys = oldStyle && Object.keys(oldStyle);
|
const oldStyleKeys = oldStyle && Object.keys(oldStyle);
|
||||||
const metaEqual = oldStyleKeys &&
|
const metaEqual = oldStyleKeys &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user