on main help sign in
Modernize min/max usage in permission dialog
fa5840cKujtim Hoxha
internal/tui/components/dialog/permission.go+2−6
@@ -199,12 +199,8 @@ func (p *permissionDialogCmp) render() string {
199
199
200 // Add some padding to the content lines
200 // Add some padding to the content lines
201 contentHeight := contentLines + 2
201 contentHeight := contentLines + 2
202− if contentHeight < minContentHeight {
203− contentHeight = minContentHeight
202+ contentHeight = max(contentHeight, minContentHeight)
204− }
205− if contentHeight > maxContentHeight {
206− contentHeight = maxContentHeight
203+ contentHeight = min(contentHeight, maxContentHeight)
207− }
208 p.contentViewPort.Height = contentHeight
204 p.contentViewPort.Height = contentHeight
209
205
210 p.contentViewPort.SetContent(renderedContent)
206 p.contentViewPort.SetContent(renderedContent)