diff options
Diffstat (limited to 'internal/client/ui/core/core.go')
| -rw-r--r-- | internal/client/ui/core/core.go | 7 |
1 files changed, 5 insertions, 2 deletions
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()) |
