Browse Source

fix: allow saving unchanged relay group name

imwald
codytseng 1 year ago
parent
commit
11d035f719
  1. 3
      src/renderer/src/components/RelaySettings/RelayGroup.tsx
  2. 2
      src/renderer/src/components/ui/input.tsx

3
src/renderer/src/components/RelaySettings/RelayGroup.tsx

@ -82,6 +82,9 @@ function RelayGroupName({ groupName }: { groupName: string }) {
const hasRelayUrls = relayGroups.find((group) => group.groupName === groupName)?.relayUrls.length const hasRelayUrls = relayGroups.find((group) => group.groupName === groupName)?.relayUrls.length
const saveNewGroupName = () => { const saveNewGroupName = () => {
if (groupName === newGroupName) {
return setRenamingGroup(null)
}
if (relayGroups.find((group) => group.groupName === newGroupName)) { if (relayGroups.find((group) => group.groupName === newGroupName)) {
return setNewNameError(t('relay collection name already exists')) return setNewNameError(t('relay collection name already exists'))
} }

2
src/renderer/src/components/ui/input.tsx

@ -10,7 +10,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input <input
type={type} type={type}
className={cn( 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 className
)} )}
ref={ref} ref={ref}

Loading…
Cancel
Save