Skip to content

Commit

Permalink
tui: disk: Fix warning labels
Browse files Browse the repository at this point in the history
Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Apr 27, 2019
1 parent 13ca315 commit 9d2e3d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tui/media_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ func newMediaConfigPage(tui *Tui) (Page, error) {
page.group.AddItem(page.safeRadio)
page.safeRadio.OnChange(func(active bool) {
if active {
page.labelWarning.SetTitle("")
page.labelDestructive.SetTitle("")
page.isDestructiveSelected = false
}
// Disable the Confirm Button if we toggled
Expand All @@ -223,14 +225,10 @@ func newMediaConfigPage(tui *Tui) (Page, error) {

if active {
if len(page.safeTargets) < 1 {
if active {
warning := "No media or space available for installation"
log.Warning(warning)
warning = fmt.Sprintf("Warning: %s", warning)
page.labelWarning.SetTitle(warning)
}
} else {
page.labelDestructive.SetTitle("")
warning := "No media or space available for installation"
log.Warning(warning)
warning = fmt.Sprintf("Warning: %s", warning)
page.labelWarning.SetTitle(warning)
}
}
})
Expand All @@ -246,6 +244,8 @@ func newMediaConfigPage(tui *Tui) (Page, error) {
page.group.AddItem(page.destructiveRadio)
page.destructiveRadio.OnChange(func(active bool) {
if active {
page.labelWarning.SetTitle("")
page.labelDestructive.SetTitle("")
page.isSafeSelected = false
}
// Disable the Confirm Button if we toggled
Expand Down

0 comments on commit 9d2e3d9

Please sign in to comment.