avoiding multiple API calls on selecting same role for a user under manage users
This commit is contained in:
parent
df1ee35992
commit
34da849cbd
|
|
@ -97,9 +97,11 @@ function TableDropdown(props: DropdownProps) {
|
|||
}, [props.selectedIndex]);
|
||||
|
||||
const optionSelector = (index: number) => {
|
||||
setSelectedIndex(index);
|
||||
setSelectedOption(props.options[index]);
|
||||
props.onSelect && props.onSelect(props.options[index]);
|
||||
if (index !== selectedIndex) {
|
||||
setSelectedIndex(index);
|
||||
setSelectedOption(props.options[index]);
|
||||
props.onSelect && props.onSelect(props.options[index]);
|
||||
}
|
||||
setIsDropdownOpen(false);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user