Skip to content

Commit 85cd00a

Browse files
author
Kristifor
committed
Code refactoring
1 parent 3c22909 commit 85cd00a

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Pages/Landing.razor

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -526,35 +526,37 @@
526526

527527
async void Callback(bool status)
528528
{
529-
InvokeAsync(() =>
529+
if(status)
530530
{
531-
Communication.ShowLoader = "none";
532-
Communication.HideTokenList = "";
533-
Communication.HideTokenSend = "none";
534-
Communication.ShowPinPanel = "none";
535-
Communication.Receipt = "none";
536-
537-
StateHasChanged();
538-
539-
});
540-
531+
var result = await PaymentService.BeginTransaction();
541532

542-
var result = await PaymentService.BeginTransaction();
533+
if (result != null)
534+
{
535+
await InvokeAsync(() =>
536+
{
537+
Communication.ShowLoader = "none";
538+
Communication.HideTokenList = "none";
539+
Communication.HideTokenSend = "none";
540+
Communication.ShowPinPanel = "none";
541+
Communication.Receipt = "flex";
542+
Receipt = result;
543+
StateHasChanged();
543544

544-
if (result != null)
545-
{
546-
await InvokeAsync(() =>
545+
});
546+
}
547+
}
548+
else
549+
InvokeAsync(() =>
547550
{
548551
Communication.ShowLoader = "none";
549-
Communication.HideTokenList = "none";
552+
Communication.HideTokenList = "";
550553
Communication.HideTokenSend = "none";
551554
Communication.ShowPinPanel = "none";
552-
Communication.Receipt = "flex";
553-
Receipt = result;
555+
Communication.Receipt = "none";
556+
554557
StateHasChanged();
555558

556559
});
557-
}
558560

559561
}
560562

Pages/LoginPanel.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@page "/LoginPanel"
22
@using System.Net
3-
@using System.Timers
43
@using System.Numerics
54
@using NFTLock.Data
65
@using Newtonsoft.Json
@@ -54,7 +53,6 @@
5453
@code {
5554

5655
private string Password{ get; set; }
57-
System.Timers.Timer aTimer { get; set; }
5856
IHardwareService HardwareService { get; set; }
5957
ICommunication Communication { get; set; }
6058

0 commit comments

Comments
 (0)