From ac1123f5e04e7ef7a695f02bb66eb7fe1134899c Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 22 Nov 2024 12:43:09 +0200 Subject: Ctrl+C is now a global keybind --- internal/client/gateway/gateway.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/client/gateway') 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) -- cgit v1.3.1