Fix tea login add with ssh public key bug (#789)

Fix #705

Reviewed-on: https://gitea.com/gitea/tea/pulls/789
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2025-08-11 19:23:28 +00:00
parent d2ccead88b
commit d643e94a69
2 changed files with 10 additions and 2 deletions

View File

@ -5,6 +5,7 @@ package interact
import (
"fmt"
"slices"
"strings"
"time"
@ -125,7 +126,9 @@ func promptSelect(prompt string, options []string, customVal, noneVal, defaultVa
if defaultVal == "" && noneVal != "" {
defaultVal = noneVal
}
if len(options) > 0 && !slices.Contains(options, defaultVal) {
defaultVal = options[0]
}
selection = defaultVal
if err := huh.NewSelect[string]().
Title(prompt).