preventing the last item to be unselected (#15873)

Fix https://github.com/twentyhq/twenty/issues/15867
This commit is contained in:
Guillim
2025-11-18 11:17:49 +01:00
committed by GitHub
parent f86c5e78b1
commit 9e425ee684
@@ -147,6 +147,9 @@ export const SettingsMorphRelationMultiSelect = ({
const addOrRemoveFromArray = (array: string[], item: string) => {
let newArray = new Set(array);
if (newArray.has(item)) {
if (newArray.size <= 1) {
return array;
}
newArray.delete(item);
} else {
newArray.add(item);