Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleValueChange(newValue, meta) {
if (meta.patch.lightBox) {
const { lightBox } = newValue;
const items = newValue.items.map(el =>
mergeIn(el, ["value"], {
linkType: lightBox === "on" ? "lightBox" : "external",
linkLightBox: lightBox
})
);
newValue = mergeIn(newValue, ["items"], items);
}
super.handleValueChange(newValue, meta);
}
const items = newValue.items.map(el =>
mergeIn(el, ["value"], {
linkType: lightBox === "on" ? "lightBox" : "external",
linkLightBox: lightBox
})
);
handleNavChange = (value, index) => {
if (value === undefined) {
this.removeItem(index);
} else {
const dbValue = this.getDBValue();
const updatedValue = mergeIn(dbValue, [index, "value"], {
labelText: value
});
this.handleValueChange(updatedValue, {
arrayOperation: "itemChange"
});
}
};