summaryrefslogtreecommitdiff
path: root/internal/client/ui/core/core.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-01-12 17:57:54 +0200
committerKyren223 <Kyren223@proton.me>2025-01-12 17:57:54 +0200
commitbff19b516e69284b0a96087a094a9d811d630b85 (patch)
tree2aafe081e77c0dabe569ad09882fabd4eb52d3f3 /internal/client/ui/core/core.go
parent1c09d173d733b491970841add0a20bf2ecf078cd (diff)
Fixed network positioning issues
Diffstat (limited to 'internal/client/ui/core/core.go')
-rw-r--r--internal/client/ui/core/core.go7
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())