fix(profile): standardize JSRuntime usage in ChargeCreditWallet component
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 27m33s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 27m33s
- Updated references to `jsRuntime` to `JSRuntime` for consistency across the ChargeCreditWallet component. - Improved the clarity of the code by ensuring uniform naming conventions in the handling of return URLs. These changes enhance code readability and maintainability in the ChargeCreditWallet functionality.
This commit is contained in:
@@ -38,7 +38,7 @@ public partial class ChargeCreditWallet : ComponentBase
|
||||
{
|
||||
if (firstRender && !string.IsNullOrEmpty(_pendingReturnUrl))
|
||||
{
|
||||
await CreditChargeNavigation.SaveReturnUrlAsync(jsRuntime, _pendingReturnUrl);
|
||||
await CreditChargeNavigation.SaveReturnUrlAsync(JSRuntime, _pendingReturnUrl);
|
||||
}
|
||||
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
@@ -54,10 +54,10 @@ public partial class ChargeCreditWallet : ComponentBase
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_pendingReturnUrl))
|
||||
await CreditChargeNavigation.SaveReturnUrlAsync(jsRuntime, _pendingReturnUrl);
|
||||
await CreditChargeNavigation.SaveReturnUrlAsync(JSRuntime, _pendingReturnUrl);
|
||||
else
|
||||
{
|
||||
var storedReturnUrl = await CreditChargeNavigation.GetReturnUrlAsync(jsRuntime);
|
||||
var storedReturnUrl = await CreditChargeNavigation.GetReturnUrlAsync(JSRuntime);
|
||||
if (CreditChargeNavigation.IsValidReturnUrl(storedReturnUrl))
|
||||
_pendingReturnUrl = storedReturnUrl;
|
||||
}
|
||||
@@ -86,8 +86,8 @@ public partial class ChargeCreditWallet : ComponentBase
|
||||
|
||||
private async Task ContinueShoppingAsync()
|
||||
{
|
||||
var returnUrl = await CreditChargeNavigation.GetReturnUrlAsync(jsRuntime);
|
||||
await CreditChargeNavigation.ClearReturnUrlAsync(jsRuntime);
|
||||
var returnUrl = await CreditChargeNavigation.GetReturnUrlAsync(JSRuntime);
|
||||
await CreditChargeNavigation.ClearReturnUrlAsync(JSRuntime);
|
||||
|
||||
if (CreditChargeNavigation.IsValidReturnUrl(returnUrl))
|
||||
Navigation.NavigateTo(returnUrl!);
|
||||
|
||||
@@ -143,7 +143,7 @@ public partial class CheckoutSummary : ComponentBase
|
||||
});
|
||||
|
||||
var result = await dialog.Result;
|
||||
if (result is { Canceled: false, Data: long chargeShortfall })
|
||||
if (result is { Canceled: false } && result.Data is long chargeShortfall)
|
||||
{
|
||||
var chargeAmount = CreditChargeNavigation.NormalizeChargeAmount(chargeShortfall);
|
||||
Navigation.NavigateTo(CreditChargeNavigation.BuildChargeUrl(
|
||||
|
||||
Reference in New Issue
Block a user