From de8ee21cc6410bd0c4ae119131a49f477ae265d5 Mon Sep 17 00:00:00 2001 From: Raiquen Date: Mon, 5 Feb 2024 14:37:23 +0100 Subject: [PATCH] fix: now rule name gets updates when a default rule is replaced --- utils/defaultRulesUpdate.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/defaultRulesUpdate.js b/utils/defaultRulesUpdate.js index fe67076..982dc16 100644 --- a/utils/defaultRulesUpdate.js +++ b/utils/defaultRulesUpdate.js @@ -128,7 +128,10 @@ function composeNewCSSRulesArray(currentCSSRules, oldRulesIndexAndNewRulesUUID, */ export function replaceRules(oldRulesIndexAndNewRulesUUID, currentCSSRule, newDefaultRules) { for (const oldRuleIndexAndNewRuleUUID of oldRulesIndexAndNewRulesUUID) { - currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].rule = newDefaultRules[oldRuleIndexAndNewRuleUUID.newRuleUUID] + const newRule = newDefaultRules[oldRuleIndexAndNewRuleUUID.newRuleUUID] + currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].rule = newRule + const newName = getRuleName(newRule) + currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].name = newName } }