Skip to content

Commit 301921d

Browse files
SalmaElsolyashraffouda
authored andcommitted
fix: rendering on uninitialized nested widgets
1 parent 4d263e5 commit 301921d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmds/modules/zui/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func action(ctx *cli.Context) error {
108108
log.Error().Err(err).Msg("failed to start services renderer")
109109
}
110110

111+
var isInitialized atomic.Bool
112+
111113
go func() {
112114
<-done
113115

@@ -129,6 +131,8 @@ func action(ctx *cli.Context) error {
129131
if err := resourcesRender(client, resources, &flag); err != nil {
130132
log.Error().Err(err).Msg("failed to start resources renderer")
131133
}
134+
135+
isInitialized.Store(true)
132136
}()
133137

134138
mod := zui.New(ctx.Context, errorsParagraph, &flag)
@@ -142,6 +146,10 @@ func action(ctx *cli.Context) error {
142146
}()
143147

144148
render := func() {
149+
if !isInitialized.Load() {
150+
ui.Render(header, services, errorsParagraph)
151+
return
152+
}
145153
ui.Render(header, services, netgrid, resources, errorsParagraph)
146154
}
147155

0 commit comments

Comments
 (0)