check if bot online before checking for outstanding trades (#2887)

This commit is contained in:
Ryzhehvost 2023-04-23 13:14:07 +03:00 committed by GitHub
parent a44e9ab34b
commit 7721106fc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3195,7 +3195,11 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
await CheckOccupationStatus().ConfigureAwait(false);
}
private void OnTradeCheckTimer(object? state = null) => Utilities.InBackground(Trading.OnNewTrade);
private void OnTradeCheckTimer(object? state = null) {
if (IsConnectedAndLoggedOn) {
Utilities.InBackground(Trading.OnNewTrade);
}
}
private void OnUserNotifications(UserNotificationsCallback callback) {
ArgumentNullException.ThrowIfNull(callback);