From 463769b5492872b2f66f72faeb7bde235a17457a Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Wed, 17 Sep 2025 09:33:34 +0200 Subject: [PATCH] App: Fix auto selection of weighing mode --- Elwig/App.xaml.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Elwig/App.xaml.cs b/Elwig/App.xaml.cs index 98f916a..afb14b5 100644 --- a/Elwig/App.xaml.cs +++ b/Elwig/App.xaml.cs @@ -115,16 +115,6 @@ namespace Elwig { BranchNum = branches.Count; } - if (Config.WeighingMode == null) { - if (App.Client.IsMatzen || App.Client.IsWolkersdorf) { - Config.WeighingMode = WeighingMode.Net; - } else if (App.Client.IsHaugsdorf || App.Client.IsSitzendorf) { - Config.WeighingMode = WeighingMode.Box; - } else if (App.Client.IsBaden || App.Client.IsGrInzersdorf) { - Config.WeighingMode = WeighingMode.Gross; - } - } - Utils.RunBackground("Temp File Cleanup", () => { Utils.CleanupTempFiles(); return Task.CompletedTask; @@ -172,6 +162,16 @@ namespace Elwig { Shutdown(); } + if (Config.WeighingMode == null) { + if (Client.IsMatzen || Client.IsWolkersdorf) { + Config.WeighingMode = WeighingMode.Net; + } else if (Client.IsHaugsdorf || Client.IsSitzendorf) { + Config.WeighingMode = WeighingMode.Box; + } else if (Client.IsBaden || Client.IsGrInzersdorf) { + Config.WeighingMode = WeighingMode.Gross; + } + } + base.OnStartup(evt); var window = new MainWindow();