Skip to content

Commit

Permalink
Fix: Remove console.log and make sure disableStrength is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Mar 19, 2024
1 parent ef392be commit 140fd2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Resources/Private/Editor/Component/Utlis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ export function generateColorObject({
continue;
}

// This removes the strength of the colors who are not selected
disableStrength.forEach((strength) => {
delete copy[key][strength];
});
if (disableStrength && Array.isArray(disableStrength) && disableStrength.length) {
// This removes the strength of the colors who are not selected
disableStrength.forEach((strength) => {
delete copy[key][strength];
});
}
}

if (Object.keys(copy).length) {
Expand Down Expand Up @@ -121,7 +123,6 @@ export function getPreviewBoxStyle({
}) {
const { group, strength } = state || {};
let hasValue = false;
console.log("group", group, strength);
if (group && typeof strength === "number") {
hasValue = !!(colors[group] && colors[group][strength]);
}
Expand Down
Loading

0 comments on commit 140fd2d

Please sign in to comment.