diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-22 12:25:41 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-22 12:25:41 +0200 |
| commit | 66a14bf0f1be776a6f7d193dea5b6534a28591df (patch) | |
| tree | cbc2e17f2b3416b0fca8d1ef1911dda14790ffaf /internal/client/ui/auth | |
| parent | ae8e313c4829df701042e298ccb4906c43c2ce6f (diff) | |
Refactored gateway to integrate between with the UI
Diffstat (limited to 'internal/client/ui/auth')
| -rw-r--r-- | internal/client/ui/auth/auth.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/internal/client/ui/auth/auth.go b/internal/client/ui/auth/auth.go index aa988c5..2e81a16 100644 --- a/internal/client/ui/auth/auth.go +++ b/internal/client/ui/auth/auth.go @@ -20,7 +20,7 @@ import ( "github.com/kyren223/eko/internal/client/ui" authfield "github.com/kyren223/eko/internal/client/ui/auth/field" "github.com/kyren223/eko/internal/client/ui/choicepopup" - "github.com/kyren223/eko/internal/client/ui/loadscreen" + "github.com/kyren223/eko/internal/client/ui/core" "github.com/kyren223/eko/pkg/assert" ) @@ -474,7 +474,8 @@ func (m *Model) Signup() tea.Cmd { return nil } - return authenticate(privKey) + + return ui.Transition(core.New(privKey, username)) } func (m *Model) signin() tea.Cmd { @@ -538,7 +539,8 @@ func (m *Model) signin() tea.Cmd { config.PrivateKeyPath = privateKeyFilepath }) } - return authenticate(*privKey) + + return ui.Transition(core.New(*privKey, "")) } func (m Model) ButtonIndex() int { @@ -579,10 +581,3 @@ func expandPath(path string) string { return path } -func authenticate(privKey ed25519.PrivateKey) tea.Cmd { - text := lipgloss.NewStyle().Inline(true). - Render("Update Failed - retrying in 3 sec...") - return ui.Transition(loadscreen.New(text, func(msg tea.Msg) tea.Cmd { - return nil - })) -} |
