Skip to content

Commit

Permalink
Merge pull request nicehash#2508 from nicehash/not_profitable_NL-1539
Browse files Browse the repository at this point in the history
not_profitable_NL-1539/NL-1538
  • Loading branch information
S74nk0 authored Oct 6, 2021
2 parents 6721d2b + e888edd commit 4b65251
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/NHMCore/Notifications/AvailableNotifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,18 @@ public static void CreateUnavailableAllMarketsLocationInfo()
public static void CreateNotProfitableInfo(bool shouldClear)
{
// clear old state
var profitNotifications = NotificationsManager.Instance.Notifications.Where(notif => notif.Group == NotificationsGroup.Profit);
foreach (var profitNotif in profitNotifications)
try
{
NotificationsManager.Instance.RemoveNotificationFromList(profitNotif);
var profitNotification = NotificationsManager.Instance.Notifications.FirstOrDefault(notif => notif.Group == NotificationsGroup.Profit);
if(profitNotification != null) NotificationsManager.Instance.Notifications.Remove(profitNotification);
}
catch (Exception ex)
{
Logger.Error("Notifications", ex.Message);
}

if (!shouldClear)
{
var notification = new Notification(NotificationsType.Warning, NotificationsGroup.Profit, Tr("Mining not profitable"), Tr("Currently mining is not profitable. Mining will be stopped."));
var notification = new Notification(NotificationsType.Warning, NotificationsGroup.Profit, Tr("Mining not profitable"), Tr("Currently mining is not profitable. Mining will be resumed once it will be profitable again."));
NotificationsManager.Instance.AddNotificationToList(notification);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/NiceHashMiner/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -4146,6 +4146,9 @@
},
"No available algorithms": {

},
"Currently mining is not profitable. Mining will be resumed once it will be profitable again.": {

}
}
}

0 comments on commit 4b65251

Please sign in to comment.