Skip to content

Commit

Permalink
pam/qrcodemodel: Do not add an empty line if code is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Jul 3, 2024
1 parent dd7d4ce commit c87c301
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pam/internal/adapter/qrcodemodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func (m qrcodeModel) View() string {
qrcodeWidth := lipgloss.Width(qr)

style := centeredStyle.Width(qrcodeWidth)
fields = append(fields, style.Render(m.code))
if m.code != "" {
fields = append(fields, style.Render(m.code))
}

if m.buttonModel != nil {
fields = append(fields, style.Render(m.buttonModel.View()))
Expand Down

0 comments on commit c87c301

Please sign in to comment.