Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit fa5840c

Browse files
kujtimiihoxhatermai
andcommitted
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>
1 parent 1d467df commit fa5840c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/tui/components/dialog/permission.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

0 commit comments

Comments
 (0)