Skip to content

Commit 2bcba8a

Browse files
Merge pull request #56 from KristiforMilchev/development
Ops recursion issue resolved
2 parents 86fa7ea + 46f0942 commit 2bcba8a

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

MauiProgram.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ namespace SYNCWallet;
1414

1515
public static class MauiProgram
1616
{
17-
static ICommunication Communication { get; set; }
18-
public static MauiApp MauiApp { get; set; }
17+
public static MauiApp MauiApp { get; set; }
1918

2019

2120
//TODO Clean all global dependebcuesm create a wraooer for all varibles and extract the hardware reading code to a serivce.
@@ -46,9 +45,6 @@ public static MauiApp CreateMauiApp()
4645

4746
MauiApp = builder.Build();
4847

49-
Communication = ServiceHelper.GetService<ICommunication>();
50-
Communication.Init();
51-
5248
return MauiApp;
5349

5450
}

Pages/Index.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@
6969
protected override async Task OnInitializedAsync()
7070
{
7171

72-
Communication = ServiceHelper.GetService<ICommunication>();
7372
AuthenicationHandler = ServiceHelper.GetService<IAuthenicationService>();
7473
HardwareService = ServiceHelper.GetService<IHardwareService>();
74+
Communication = ServiceHelper.GetService<ICommunication>();
7575

7676

77+
Communication.Init();
7778
//Get Supported Devices
7879
Devices = HardwareService.GetSupportedDevices();
7980

Services/Implementation/Communication.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ public class Communication : ICommunication
4848
public string ShowLoader { get; set; }
4949
public string Receipt { get; set; }
5050

51-
public Communication()
52-
{
53-
Utilities = ServiceHelper.GetService<IUtilities>();
54-
AuthenicationService = ServiceHelper.GetService<IAuthenicationService>();
55-
}
51+
5652

5753
public bool CheckConfigured()
5854
{
@@ -257,6 +253,8 @@ public void WriteState(string value)
257253

258254
public void Init()
259255
{
256+
Utilities = ServiceHelper.GetService<IUtilities>();
257+
AuthenicationService = ServiceHelper.GetService<IAuthenicationService>();
260258

261259
HideTokenList = "none";
262260
HideTokenSend = "none";

0 commit comments

Comments
 (0)