mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Extra misc fixes
This commit is contained in:
@@ -84,19 +84,16 @@ namespace ArchiSteamFarm {
|
||||
private static HttpListener HttpListener;
|
||||
private static bool IsHandlingRequests;
|
||||
|
||||
internal static void OnNewHistoryTarget(HistoryTarget historyTarget) {
|
||||
if (historyTarget == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(historyTarget));
|
||||
return;
|
||||
}
|
||||
|
||||
internal static void OnNewHistoryTarget(HistoryTarget historyTarget = null) {
|
||||
if (HistoryTarget != null) {
|
||||
HistoryTarget.NewHistoryEntry -= OnNewHistoryEntry;
|
||||
HistoryTarget = null;
|
||||
}
|
||||
|
||||
historyTarget.NewHistoryEntry += OnNewHistoryEntry;
|
||||
HistoryTarget = historyTarget;
|
||||
if (historyTarget != null) {
|
||||
historyTarget.NewHistoryEntry += OnNewHistoryEntry;
|
||||
HistoryTarget = historyTarget;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Start(HashSet<string> prefixes) {
|
||||
|
||||
@@ -84,15 +84,9 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
HistoryTarget historyTarget;
|
||||
HistoryTarget historyTarget = LogManager.Configuration.AllTargets.OfType<HistoryTarget>().FirstOrDefault();
|
||||
|
||||
if (IsUsingCustomConfiguration) {
|
||||
historyTarget = LogManager.Configuration.AllTargets.OfType<HistoryTarget>().FirstOrDefault();
|
||||
|
||||
if (historyTarget == null) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ((historyTarget == null) && !IsUsingCustomConfiguration) {
|
||||
// TODO: We could use some nice HTML layout for this
|
||||
historyTarget = new HistoryTarget("History") {
|
||||
Layout = GeneralLayout,
|
||||
@@ -167,11 +161,8 @@ namespace ArchiSteamFarm {
|
||||
OnUserInputStart();
|
||||
}
|
||||
|
||||
HistoryTarget historyTarget = (HistoryTarget) LogManager.Configuration.AllTargets.FirstOrDefault(target => target is HistoryTarget);
|
||||
|
||||
if (historyTarget != null) {
|
||||
IPC.OnNewHistoryTarget(historyTarget);
|
||||
}
|
||||
HistoryTarget historyTarget = LogManager.Configuration.AllTargets.OfType<HistoryTarget>().FirstOrDefault();
|
||||
IPC.OnNewHistoryTarget(historyTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user