mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
Deleting options and colors at the same time
This commit is contained in:
@@ -100,6 +100,7 @@ export const updateColumnAtom = atom(
|
||||
// Reduce array into single object with updated indexes
|
||||
const updatedColumns = tableColumnsOrdered.reduce(tableColumnsReducer, {});
|
||||
await updateTableSchema({ columns: updatedColumns });
|
||||
console.log(updatedColumns); // Testing Purpose Only @devsgnr
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -78,8 +78,9 @@ export default function ColumnConfigModal({
|
||||
) {
|
||||
setShowRebuildPrompt(true);
|
||||
}
|
||||
const updatedConfig = set({ ...newConfig }, key, update);
|
||||
const updatedConfig = set(newConfig, key, update); // Modified by @devsgnr, spread operator `{...newConfig}` instead of just `newConfig` was preventing multiple calls from running properly
|
||||
setNewConfig(updatedConfig);
|
||||
console.log(updatedConfig); // Testing Purpose Only @devsgnr
|
||||
validateSettings();
|
||||
};
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ const getItemStyle = (
|
||||
|
||||
export default function Settings({ onChange, config }: ISettingsProps) {
|
||||
const listEndRef: any = useRef(null);
|
||||
let options = config.options ?? [];
|
||||
const options = config.options ?? [];
|
||||
const [newOption, setNewOption] = useState("");
|
||||
|
||||
/* State for holding Chip Colors for Select and MultiSelect */
|
||||
const colors = config.colors ?? {};
|
||||
let colors = config.colors ?? {};
|
||||
|
||||
const handleAdd = () => {
|
||||
if (newOption.trim() !== "") {
|
||||
@@ -145,10 +145,9 @@ export default function Settings({ onChange, config }: ISettingsProps) {
|
||||
<IconButton
|
||||
aria-label="Remove"
|
||||
onClick={() =>
|
||||
handleItemDelete(option).then(() => {
|
||||
handleChipColorChange("delete", option);
|
||||
console.log(options, colors); // Here for debugging purposes
|
||||
})
|
||||
handleItemDelete(option).then(
|
||||
() => handleChipColorChange("delete", option) //@devsgnr
|
||||
)
|
||||
}
|
||||
>
|
||||
{<RemoveIcon />}
|
||||
|
||||
Reference in New Issue
Block a user