diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-01-06 18:23:41 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-01-06 18:23:41 +0200 |
| commit | 63790c069fbca0c3548fdaa58148e6cefdf477d5 (patch) | |
| tree | 8ba0e84d0334e13fcb36134789791dadfb0bfde7 /internal/client/ui/core/core.go | |
| parent | 1a218730e9a0c16fd71f4606adfde5862be2e7b7 (diff) | |
Server and client now properly handle the same user logging in from
different locations, fixed the issue where it'd only work for the first
time by checking if the addresses match before remove the session
Diffstat (limited to 'internal/client/ui/core/core.go')
| -rw-r--r-- | internal/client/ui/core/core.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index 50abbe6..1e2bc6a 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -179,6 +179,12 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { m.timeout = initialTimeout return tea.Batch(gateway.Connect(m.privKey, connectionTimeout), m.loading.Init()) + case *packet.Error: + err := "new connection from another location, closing this one" + if msg.PktType == packet.PacketError && err == msg.Error { + return ui.Transition(ui.NewAuth()) + } + case *packet.NetworksInfo: if msg.Set { state.State.Networks = msg.Networks |
