Skip to content

Commit 12f87d9

Browse files
committed
remove registrar error when node is registered
Signed-off-by: Ashraf Fouda <ashraf.m.fouda@gmail.com>
1 parent e242005 commit 12f87d9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

cmds/modules/zui/header.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ func headerRenderer(ctx context.Context, c zbus.Client, h *widgets.Paragraph, r
5656
}
5757

5858
go func() {
59-
registrarLable := "registrar"
59+
registrarLabel := "registrar"
6060
zui := stubs.NewZUIStub(c)
6161

6262
// empty out zui errors for registrar
63-
if zuiErr := zui.PushErrors(ctx, registrarLable, []string{}); zuiErr != nil {
63+
if zuiErr := zui.PushErrors(ctx, registrarLabel, []string{}); zuiErr != nil {
6464
log.Info().Err(zuiErr).Send()
6565
}
6666

@@ -80,12 +80,16 @@ func headerRenderer(ctx context.Context, c zbus.Client, h *widgets.Paragraph, r
8080
nodeID = green(err.Error())
8181
} else {
8282
nodeID = red(fmt.Sprintf("%d (unregistered)", node))
83-
if zuiErr := zui.PushErrors(ctx, registrarLable, []string{err.Error()}); zuiErr != nil {
83+
if zuiErr := zui.PushErrors(ctx, registrarLabel, []string{err.Error()}); zuiErr != nil {
8484
log.Info().Err(zuiErr).Send()
8585
}
8686
}
8787
} else {
8888
nodeID = green(fmt.Sprint(node))
89+
// Clear registrar errors when registration succeeds
90+
if zuiErr := zui.PushErrors(ctx, registrarLabel, []string{}); zuiErr != nil {
91+
log.Info().Err(zuiErr).Send()
92+
}
8993
}
9094

9195
cache := green("OK")

0 commit comments

Comments
 (0)