Skip to content

Commit

Permalink
Merge pull request #33 from Kenny1291/31-rules-update-is-not-working
Browse files Browse the repository at this point in the history
fix: now rule name gets updates when a default rule is replaced
  • Loading branch information
Raiquen Guidotti committed Feb 5, 2024
2 parents 4f97904 + de8ee21 commit 8096da0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/defaultRulesUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 8096da0

Please sign in to comment.