fix: allow saving unchanged relay group name
This commit is contained in:
@@ -82,6 +82,9 @@ function RelayGroupName({ groupName }: { groupName: string }) {
|
||||
const hasRelayUrls = relayGroups.find((group) => group.groupName === groupName)?.relayUrls.length
|
||||
|
||||
const saveNewGroupName = () => {
|
||||
if (groupName === newGroupName) {
|
||||
return setRenamingGroup(null)
|
||||
}
|
||||
if (relayGroups.find((group) => group.groupName === newGroupName)) {
|
||||
return setNewNameError(t('relay collection name already exists'))
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
'flex h-8 w-full rounded-lg p-2 text-sm bg-muted border border-muted ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'flex h-8 w-full rounded-lg p-2 border border-muted ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-transparent disabled:cursor-not-allowed disabled:opacity-50',
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
|
||||
Reference in New Issue
Block a user