From 66a14bf0f1be776a6f7d193dea5b6534a28591df Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 22 Nov 2024 12:25:41 +0200 Subject: Refactored gateway to integrate between with the UI --- internal/client/ui/auth/auth.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'internal/client/ui/auth/auth.go') 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 - })) -} -- cgit v1.3.1