Skip to content

Commit

Permalink
Liten refaktor på MiljoVelger
Browse files Browse the repository at this point in the history
#deploy-idporten-frontend
  • Loading branch information
stigus committed Mar 21, 2024
1 parent 85daff4 commit aa63c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Steg3 = () => {

const [gruppevalg, setGruppevalg] = useState(Gruppevalg.MINE)

const { organisasjonTilgang } = useOrganisasjonTilgang()
const { organisasjonTilgang, loading } = useOrganisasjonTilgang()
const tilgjengeligMiljoe = organisasjonTilgang?.miljoe

const importTestnorge = opts.is.importTestnorge
Expand All @@ -47,7 +47,9 @@ export const Steg3 = () => {
const harRelatertPersonBarn = forelderBarnRelasjon?.some((item) => item.relatertPerson)

const alleredeValgtMiljoe = () => {
if (bankIdBruker) {
if (loading) {
return []
} else if (bankIdBruker) {
return tilgjengeligMiljoe ? [tilgjengeligMiljoe] : ['q1']
}
return erQ2MiljoeAvhengig ? ['q2'] : []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const MiljoVelger = ({
const onClick = (e) => {
const { id } = e.target
console.log('id: ', id) //TODO - SLETT MEG
console.log('alleredeValgtMiljoe: ', alleredeValgtMiljoe) //TODO - SLETT MEG
console.log('e: ', e) //TODO - SLETT MEG
if (!alleredeValgtMiljoe?.includes(id)) {
formMethods.setValue(
Expand Down

0 comments on commit aa63c54

Please sign in to comment.