Skip to content

Commit

Permalink
Added client check for initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Eternal-ll committed Feb 4, 2024
1 parent dea4978 commit 7f1989b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ private async Task HandleActivationAsync()
await _settingsManager.LoadAsync();
_navigationWindow.ShowWindow();

if (_settingsManager.Settings.SelectedFaServer == null)
if (!_settingsManager.Settings.ClientInitialized)
{
_navigationWindow.Navigate(typeof(SelectServerView));
_navigationWindow.Navigate(typeof(PrepareClientView));
}
else if (_settingsManager.Settings.SelectedFaServer == null)
{
_navigationWindow.Navigate(typeof(SelectServerView));
}
else
{
Expand Down
1 change: 1 addition & 0 deletions Ethereal.FAF.UI.Client/Models/Settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Settings : JsonSettings, INotifyPropertyChanged

public virtual UpdateChannel PreferredUpdateChannel { get; set; } = UpdateChannel.Stable;

public virtual bool ClientInitialized { get; set; }


public virtual bool RememberSelectedFaServer { get; set; } = true;
Expand Down
3 changes: 3 additions & 0 deletions Ethereal.FAF.UI.Client/ViewModels/PrepareClientViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Ethereal.FAF.UI.Client.Infrastructure.Helper;
using Ethereal.FAF.UI.Client.Infrastructure.Services;
using Ethereal.FAF.UI.Client.Infrastructure.Services.Interfaces;
using Ethereal.FAF.UI.Client.Infrastructure.Utils;
using Ethereal.FAF.UI.Client.Models.Progress;
Expand Down Expand Up @@ -258,6 +259,8 @@ private void LoadFiles()
{
if (x.IsCompletedSuccessfully)
{
_settingsManager.Settings.ClientInitialized = true;
_settingsManager.Settings.Save();
App.Current.Dispatcher.Invoke(() => _navigationWindow.Navigate(typeof(AuthView)));
}
}).SafeFireAndForget();
Expand Down

0 comments on commit 7f1989b

Please sign in to comment.