This commit is contained in:
MeysamMoghaddam
2025-10-22 19:11:28 +03:30
parent 47a185bfbe
commit 0b253074a9
3 changed files with 25 additions and 24 deletions
+20 -17
View File
@@ -10,7 +10,7 @@ namespace FrontOffice.Main;
public partial class App
{
[Inject] private ILocalStorageService LocalStorage { get; set; } = default!;
[Inject] private AuthService AuthService { get; set; } = default!;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
@@ -27,25 +27,28 @@ public partial class App
// Store referral code in local storage
await LocalStorage.SetItemAsync("referral:code", referralCode);
var options = new DialogOptions
if(!await AuthService.IsAuthenticatedAsync())
{
BackdropClick = false,
CloseOnEscapeKey = false
};
var options = new DialogOptions
{
BackdropClick = false,
CloseOnEscapeKey = false
};
var parameters = new DialogParameters<AuthDialog>
{
{ x => x.HideCancelButton, true }
};
var dialog = await DialogService.ShowAsync<AuthDialog>("ورود به حساب کاربری", parameters, options);
var result = await dialog.Result;
var parameters = new DialogParameters<AuthDialog>
{
{ x => x.HideCancelButton, true }
};
var dialog = await DialogService.ShowAsync<AuthDialog>("ورود به حساب کاربری", parameters, options);
var result = await dialog.Result;
if (!result.Canceled)
{
Snackbar.Add(GlobalConstants.SuccessMsg, Severity.Success);
await Task.Delay(1000);
Navigation.NavigateTo(Navigation.Uri, forceLoad: true);
StateHasChanged();
if (!result.Canceled)
{
Snackbar.Add(GlobalConstants.SuccessMsg, Severity.Success);
await Task.Delay(1000);
Navigation.NavigateTo(Navigation.Uri, forceLoad: true);
StateHasChanged();
}
}
}
}