This commit is contained in:
MeysamMoghaddam
2025-10-12 23:43:34 +03:30
parent 6585c8014a
commit 5211f7ce38
9 changed files with 37 additions and 686 deletions

View File

@@ -158,6 +158,14 @@ public partial class AuthDialog : IDisposable
try
{
_verifyRequest.Mobile = _phoneNumber;
// Check for stored referral code and add it to the request
var storedReferralCode = await LocalStorage.GetItemAsync<string>("referral:code");
if (!string.IsNullOrWhiteSpace(storedReferralCode))
{
_verifyRequest.ParentReferralCode = storedReferralCode;
}
var validationResult = _verifyRequestValidator.Validate(_verifyRequest);
if (!validationResult.IsValid)
{
@@ -196,6 +204,9 @@ public partial class AuthDialog : IDisposable
await LocalStorage.RemoveItemAsync(PhoneStorageKey);
await LocalStorage.RemoveItemAsync(RedirectStorageKey);
// Clear referral code after successful registration/login
await LocalStorage.RemoveItemAsync("referral:code");
_attemptsLeft = MaxVerificationAttempts;
_verifyRequest.Code = string.Empty;

View File

@@ -49,7 +49,6 @@
else
{
<MudButton Variant="Variant.Outlined" Color="Color.Inherit" OnClick="OpenAuthDialog">ورود</MudButton>
<MudButton Color="Color.Primary">شروع کنید</MudButton>
}
</MudHidden>