feat(wallet): enhance ChargeCreditWallet and Wallet components with magic wallet functionality
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 5m28s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 5m28s
- Added logic to handle redirection and alerts for users with a magic wallet status in the ChargeCreditWallet component. - Updated the Wallet component to conditionally render buttons and alerts based on the user's magic wallet status. - Implemented a method to check the magic wallet status and provide user feedback regarding wallet charging options. These changes improve user experience by clearly guiding users on the appropriate wallet charging methods based on their current wallet status.
This commit is contained in:
@@ -14,6 +14,7 @@ public partial class Wallet : ComponentBase
|
||||
private string _filterType = "all";
|
||||
private bool _isClubMemberActive;
|
||||
private bool _hasPurchasedPackage;
|
||||
private bool _isMagicWallet;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -29,6 +30,16 @@ public partial class Wallet : ComponentBase
|
||||
_hasPurchasedPackage = false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var magicStatus = await WalletService.GetMagicWalletStatusAsync();
|
||||
_isMagicWallet = magicStatus.WalletMode == 1;
|
||||
}
|
||||
catch
|
||||
{
|
||||
_isMagicWallet = false;
|
||||
}
|
||||
|
||||
var b = await WalletService.GetBalancesAsync();
|
||||
_balances = (FormatPrice(b.CreditBalance), FormatPrice(b.DiscountBalance), FormatPrice(b.NetworkBalance));
|
||||
_txs = await WalletService.GetTransactionsAsync();
|
||||
|
||||
Reference in New Issue
Block a user