diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-22 12:43:09 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-22 12:43:09 +0200 |
| commit | ac1123f5e04e7ef7a695f02bb66eb7fe1134899c (patch) | |
| tree | 3afb0c56ad616f15ad9ee68c503b31497b040a59 /internal/client/gateway/gateway.go | |
| parent | 66a14bf0f1be776a6f7d193dea5b6534a28591df (diff) | |
Ctrl+C is now a global keybind
Diffstat (limited to 'internal/client/gateway/gateway.go')
| -rw-r--r-- | internal/client/gateway/gateway.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/client/gateway/gateway.go b/internal/client/gateway/gateway.go index 441395a..22d851f 100644 --- a/internal/client/gateway/gateway.go +++ b/internal/client/gateway/gateway.go @@ -53,8 +53,10 @@ func init() { } } -func Connect(ctx context.Context, privKey ed25519.PrivateKey) tea.Cmd { +func Connect(privKey ed25519.PrivateKey, timeout time.Duration) tea.Cmd { return func() tea.Msg { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() err := connect(ctx, privKey) if err != nil { return ConnectionFailed(err) |
