u
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user