set default owner/repo when more than 1 allowed values defined

Signed-off-by: Julius Berger <julius.berger@de.bosch.com>
This commit is contained in:
Julius Berger
2022-07-06 11:55:47 +02:00
parent 699b0cf3bd
commit a1e12ab502
@@ -89,12 +89,12 @@ export const RepoUrlPicker = (
/* we deal with calling the repo setting here instead of in each components for ease */
useEffect(() => {
if (allowedOwners.length === 1) {
if (allowedOwners.length > 0) {
setState(prevState => ({ ...prevState, owner: allowedOwners[0] }));
}
}, [setState, allowedOwners]);
useEffect(() => {
if (allowedRepos.length === 1) {
if (allowedRepos.length > 0) {
setState(prevState => ({ ...prevState, repoName: allowedRepos[0] }));
}
}, [setState, allowedRepos]);