Skip to content

Commit 94a3a87

Browse files
authored
Merge pull request #196 from HackHPI/klaraprigge/hac-33-when-completing-all-steps-and-going-back-team-name-is-gone
[hac-33] preserve team name when navigating back in registration
2 parents abf28bf + 3db1876 commit 94a3a87

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/Registration/GroupManager/GroupManager.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { GroupRest } from "../../../rest/GroupRest";
1414
export function GroupManager(props) {
1515
const [loadingNewTeam, setLoadingNewTeam] = useState(false);
1616
const [fetchingExistingTeam, setFetchingExistingTeam] = useState(false);
17-
const [group, setGroup] = useState(false);
17+
const [group, setGroup] = useState(props.value || false);
1818
const [groupInput, setGroupInput] = useState("");
1919
const [groupInputError, setGroupInputError] = useState(false);
2020
const [groupName, setGroupName] = useState("");

src/components/Registration/Registration.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ function Registration() {
280280
<GroupManager
281281
eventId={"c11a427e-f679-49b6-8574-b0d3211ad123"}
282282
onGroupChange={(change) => handleChange("group", change)}
283+
value={values.group}
283284
/>
284285
),
285286
},
@@ -345,7 +346,7 @@ function Registration() {
345346
return previous && false;
346347
}
347348

348-
if (current.regex && !values[current.name].match(current.regex)){
349+
if (current.regex && !values[current.name].match(current.regex)) {
349350
return previous && false;
350351
}
351352

0 commit comments

Comments
 (0)