Skip to content

Commit

Permalink
fix(app): allow users to use the same name after device reset (#14222)
Browse files Browse the repository at this point in the history
* fix(app): allow users to use the same name after clearing all data
  • Loading branch information
koji authored Dec 15, 2023
1 parent 8c82d7c commit 3135a08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/pages/OnDeviceDisplay/NameRobot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function NameRobot(): JSX.Element {
const history = useHistory()
const trackEvent = useTrackEvent()
const localRobot = useSelector(getLocalRobot)
const ipAddress = localRobot?.ip
const previousName = localRobot?.name != null ? localRobot.name : null
const [name, setName] = React.useState<string>('')
const [newName, setNewName] = React.useState<string>('')
Expand Down Expand Up @@ -105,7 +106,7 @@ export function NameRobot(): JSX.Element {
}
if (
[...connectableRobots, ...reachableRobots].some(
robot => newName === robot.name
robot => newName === robot.name && robot.ip !== ipAddress
)
) {
errors.newRobotName = t('name_rule_error_exist')
Expand Down

0 comments on commit 3135a08

Please sign in to comment.