Explorar el Código

Fixes to silly MYOB settings bug

Kenric Nugteren hace 11 meses
padre
commit
c37e6f3250

+ 7 - 1
InABox.Poster.MYOB/MYOBPosterEngine.cs

@@ -8,6 +8,7 @@ using MYOB.AccountRight.SDK.Contracts;
 using MYOB.AccountRight.SDK.Services;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
@@ -98,11 +99,16 @@ public static partial class MYOBPosterEngine
         }
     }
 
+    public static MYOBConnectionData? GetConnectionDataOrNull()
+    {
+        return _connectionData;
+    }
+
     public static MYOBConnectionData GetConnectionData()
     {
         if(_connectionData is MYOBConnectionData data)
         {
-            return data;
+            return _connectionData;
         }
 
         var configuration = new ApiConfiguration(DEV_KEY, SECRET_KEY, REDIRECT_URL);

+ 2 - 0
InABox.Poster.MYOB/UI/MYOBCompanyFileEditor.cs

@@ -87,6 +87,8 @@ public class MYOBCompanyFileEditorControl : DynamicEnclosedEditorControl<MYOBCom
 
     private void Select_Click(object sender, RoutedEventArgs e)
     {
+        if (e.OriginalSource != Select) return;
+
         var file = MYOBCompanyFileSelectionDialog.SelectCompanyFile();
         if(file is not null)
         {