on main help sign in
Modernize min/max usage in permission dialog

- Replace if statements with direct min/max function calls - Fix linter hint about using modern min/max functions - Simplify code for better readability ๐Ÿค– Generated with termai Co-Authored-By: termai <noreply@termai.io>

commitfa5840cf7524c85a90679ce257e34a1558b145f7 authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 4 Apr 2025, 15:05 (2 years ago) parent1d467df
1 file changed+2โˆ’6
internal/tui/components/dialog/permission.go+2โˆ’6
internal/tui/components/dialog/permission.go+2โˆ’6
@@ -199,12 +199,8 @@ func (p *permissionDialogCmp) render() string {
199199
200200 // Add some padding to the content lines
201201 contentHeight := contentLines + 2
202โˆ’ if contentHeight < minContentHeight {
203โˆ’ contentHeight = minContentHeight
204โˆ’ }
205โˆ’ if contentHeight > maxContentHeight {
206โˆ’ contentHeight = maxContentHeight
207โˆ’ }
202+ contentHeight = max(contentHeight, minContentHeight)
203+ contentHeight = min(contentHeight, maxContentHeight)
208204 p.contentViewPort.Height = contentHeight
209205
210206 p.contentViewPort.SetContent(renderedContent)