mirror of
https://github.com/anchore/syft
synced 2024-11-13 23:57:07 +00:00
chore: move wait before iteration to guarantee read before tea (#1931)
* chore: move wait before iteration to guarantee read before tea --------- Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
4fc17edd14
commit
32296f5943
1 changed files with 6 additions and 5 deletions
|
@ -19,6 +19,12 @@ func runModel(t testing.TB, m tea.Model, iterations int, message tea.Msg, h ...*
|
||||||
return message
|
return message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, each := range h {
|
||||||
|
if each != nil {
|
||||||
|
each.Wait()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; cmd != nil && i < iterations; i++ {
|
for i := 0; cmd != nil && i < iterations; i++ {
|
||||||
msgs := flatten(cmd())
|
msgs := flatten(cmd())
|
||||||
var nextCmds []tea.Cmd
|
var nextCmds []tea.Cmd
|
||||||
|
@ -31,11 +37,6 @@ func runModel(t testing.TB, m tea.Model, iterations int, message tea.Msg, h ...*
|
||||||
cmd = tea.Batch(nextCmds...)
|
cmd = tea.Batch(nextCmds...)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, each := range h {
|
|
||||||
if each != nil {
|
|
||||||
each.Wait()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return m.View()
|
return m.View()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue