From 37658869e49c26026b96a4ebb6e45fe0ec90ea97 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Tue, 23 Jan 2024 00:37:18 +0100 Subject: [PATCH] ChartWindow: Small fixes --- Elwig/Helpers/Billing/BillingData.cs | 2 +- Elwig/Helpers/Billing/EditBillingData.cs | 2 +- Elwig/Windows/ChartWindow.xaml | 25 +++++++----------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Elwig/Helpers/Billing/BillingData.cs b/Elwig/Helpers/Billing/BillingData.cs index fb94b4b..7992800 100644 --- a/Elwig/Helpers/Billing/BillingData.cs +++ b/Elwig/Helpers/Billing/BillingData.cs @@ -367,7 +367,7 @@ namespace Elwig.Helpers.Billing { } if (qualityWei.Count == 1) { data["quality"] = new JsonObject() { - ["WEI"] = qualityWei.Single().Value + ["WEI"] = qualityWei.Single().Value?.DeepClone() }; } else if (qualityWei.Count > 1) { data["quality"] = new JsonObject() { diff --git a/Elwig/Helpers/Billing/EditBillingData.cs b/Elwig/Helpers/Billing/EditBillingData.cs index ac6bce9..643641e 100644 --- a/Elwig/Helpers/Billing/EditBillingData.cs +++ b/Elwig/Helpers/Billing/EditBillingData.cs @@ -42,7 +42,7 @@ namespace Elwig.Helpers.Billing { dict2[idx].Add("default"); } - var virtOffset = dict1.Max(e => e.Key) + 1; + var virtOffset = dict1.Count > 0 ? dict1.Max(e => e.Key) + 1 : 1; Dictionary curves = GetCurves(); decimal[] virtCurves = [.. dict2.Keys.Order()]; for (int i = 0; i < virtCurves.Length; i++) { diff --git a/Elwig/Windows/ChartWindow.xaml b/Elwig/Windows/ChartWindow.xaml index 5b18c3a..1c75004 100644 --- a/Elwig/Windows/ChartWindow.xaml +++ b/Elwig/Windows/ChartWindow.xaml @@ -60,7 +60,7 @@ -