diff --git a/src/Client.cs b/src/Client.cs index 28207cf..7c383ce 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -209,6 +209,7 @@ namespace WTelegram if (_tcpClient != null) throw new InvalidOperationException("Cannot switch to HTTP after TCP connection"); _httpClient = httpClient ?? new(); _httpWait = defaultHttpWait; + while (_parallelTransfers.CurrentCount > 1) _parallelTransfers.Wait(); } /// Disconnect from Telegram (shouldn't be needed in normal usage)