Skip to content

Commit

Permalink
Check config group properly
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardMoyse committed Aug 30, 2024
1 parent f0acf10 commit 240c82d
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ export class PhoenixMenuNode {
// Apply configs of different config types - manual
if (config.type === 'checkbox' && config?.['isChecked']) {
config.onChange?.(config?.['isChecked']);
} else if (config.type === 'color' && config?.['color'] && !config.group) {
} else if (
config.type === 'color' &&
config?.['color'] &&
config.group !== undefined
) {
// Ignore color by options with `!config.group`, otherwise the collection color is overridden
config.onChange?.(config?.['color']);
} else if (config.type === 'slider' && config?.['value']) {
Expand Down Expand Up @@ -227,13 +231,12 @@ export class PhoenixMenuNode {
}

const nodeConfig = nodeConfigs[0];
console.log('nodeConfig', nodeConfig);
// console.log('nodeConfig', nodeConfig);
if (nodeConfig) {
for (const prop in configState) {
const key = prop as keyof typeof nodeConfig;
const test = typeof nodeConfig;
const test2 = configState as typeof nodeConfig;
// nodeConfig[key] = test2[key];
// console.log('prop',prop, 'key', key, 'nodeConfig[key]', nodeConfig[key]);
(nodeConfig as any)[key] = configState[key];
}

this.applyConfigState(nodeConfig);
Expand Down

0 comments on commit 240c82d

Please sign in to comment.