wait with updates until we have at least the news
This commit is contained in:
parent
a81ddf3d01
commit
e76bced86b
|
@ -36,11 +36,10 @@ export const Children = ({ navigation }) => {
|
|||
console.log('no children found', await api.getChildren())
|
||||
return navigation.navigate('Login', { error: 'Hittar inga barn för det personnumret' })
|
||||
}
|
||||
await setChildren(childrenList)
|
||||
|
||||
childrenList.forEach(async (child, i) => {
|
||||
let result
|
||||
let updatedChild
|
||||
let updatedChild // keep a reference to the latest updated information so we don't patch an old object
|
||||
const iter = fillChild(child)
|
||||
while (!result?.done) {
|
||||
result = await iter.next() // get updated values for every updated property
|
||||
|
|
Loading…
Reference in New Issue