Files
Nebula-Auth/NebulaAuth/ViewModel/Other/LoginAgainOnImportVM.cs
T
achiez 8ff960189e 1.5.6 Bug fixes and code clean-ups
- Update: Added "Copy Password" to Mafile context menu (if available)
- Update: "Save Password" now pre-fills the current password in the "Login Again" dialog when encryption is enabled
- Fix: Prevented overlapping confirmation cycles in AutoConfirmer
- Fix: Added a Snackbar notification when a confirmation cycle is skipped due to a too frequent timer interval
- Fix: Fixed a rare bug where the previous proxy was used instead of the current one during session refresh
- Fix: Corrected "Session Permanently Expired" message showing on unrelated errors (e.g. network issues)
- UI-Fix: Fixed visual glitch where proxy input appeared non-empty when switching to a mafile-specific proxy
- Cleanup: Refactored and cleaned up codebase, improved styling and formatting via ReSharper
2025-05-02 23:29:24 +03:00

67 lines
1.7 KiB
C#

using System.Collections.Generic;
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using NebulaAuth.Model.Entities;
namespace NebulaAuth.ViewModel.Other;
public partial class LoginAgainOnImportVM : ObservableObject
{
public ObservableCollection<MaProxy> Proxies { get; } = new();
public MaProxy? SelectedProxy
{
get => _selectedProxy;
set
{
if (SetProperty(ref _selectedProxy, value) && value != null)
{
UseMafileProxy = false;
}
}
}
public bool UseMafileProxy
{
get => _useMafileProxy;
set
{
if (SetProperty(ref _useMafileProxy, value) && value)
{
SelectedProxy = null;
}
}
}
public bool IsFormValid => !string.IsNullOrWhiteSpace(Password);
[ObservableProperty] private bool _mafileHasProxy;
[ObservableProperty] [NotifyPropertyChangedFor(nameof(IsFormValid))]
private string _password = null!;
[ObservableProperty] private bool _savePassword;
private MaProxy? _selectedProxy;
private bool _useMafileProxy;
[ObservableProperty] private string _userName = null!;
public LoginAgainOnImportVM(Mafile mafile, IEnumerable<MaProxy> proxies)
{
UserName = mafile.AccountName;
MafileHasProxy = mafile.Proxy != null;
UseMafileProxy = MafileHasProxy;
Proxies = new ObservableCollection<MaProxy>(proxies);
}
public LoginAgainOnImportVM()
{
}
[RelayCommand]
private void RemoveProxy()
{
SelectedProxy = null;
}
}