Skip to content

Commit

Permalink
prevent any issue when adding default rules (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny1291 authored Sep 2, 2024
1 parent aec851f commit 022c0a7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/utils/defaultRulesUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,14 @@ export function updateRules(oldRulesIndexAndNewRulesUUID, currentCSSRule, newDef
*/
export function addRules(UUIDSOfRulesToAdd, currentCSSRule, newDefaultRules) {
for (const UUIDOfRulesToAdd of UUIDSOfRulesToAdd) {
let rule
let group
for (const newDefaultRule of newDefaultRules) {
if (newDefaultRule.UUID === UUIDOfRulesToAdd) {
rule = newDefaultRule.rule
group = newDefaultRule.group
const name = getRuleName(rule)
currentCSSRule.push({ name, rule: newDefaultRule.rule, active: true, group: newDefaultRule.group})
break
}
}
const name = getRuleName(rule)
currentCSSRule.push({ name, rule, active: true, group: group})

}
}

Expand Down

0 comments on commit 022c0a7

Please sign in to comment.