From bff19b516e69284b0a96087a094a9d811d630b85 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 12 Jan 2025 17:57:54 +0200 Subject: Fixed network positioning issues --- internal/client/ui/core/core.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/client/ui/core/core.go') diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index 4dc50e2..10088bf 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -132,7 +132,7 @@ func (m *Model) updateNotConnected(msg tea.Msg) tea.Cmd { state.State.UserID = (*snowflake.ID)(&msg) m.connected = true m.timeout = initialTimeout - return m.timer.Stop() + return tea.Batch(m.timer.Stop(), gateway.Send(&packet.GetUserData{})) case gateway.ConnectionFailed: log.Println("failed to connect:", msg) @@ -175,7 +175,7 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { state.State.UserID = nil m.connected = false m.timeout = initialTimeout - return tea.Batch(gateway.Connect(m.privKey, connectionTimeout), m.loading.Init()) + return gateway.Connect(m.privKey, connectionTimeout) case *packet.Error: err := "new connection from another location, closing this one" @@ -183,6 +183,9 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { return ui.Transition(ui.NewAuth()) } + case *packet.SetUserData: + state.FromJsonUserData(msg.Data) + case *packet.NetworksInfo: state.UpdateNetworks(msg) networkId := state.NetworkId(m.networkList.Index()) -- cgit v1.3.1