mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 14:24:32 +00:00
8ff960189e
- 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
96 lines
2.4 KiB
C#
96 lines
2.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using MaterialDesignThemes.Wpf;
|
|
using NebulaAuth.Model;
|
|
using NebulaAuth.Model.Entities;
|
|
using NebulaAuth.View;
|
|
using NebulaAuth.View.Dialogs;
|
|
using NebulaAuth.ViewModel.Other;
|
|
|
|
namespace NebulaAuth.Core;
|
|
|
|
public static class DialogsController
|
|
{
|
|
#region CommonDialogs
|
|
|
|
public static async Task<bool> ShowConfirmCancelDialog(string? msg = null)
|
|
{
|
|
var content = msg == null ? new ConfirmCancelDialog() : new ConfirmCancelDialog(msg);
|
|
|
|
var result = await DialogHost.Show(content);
|
|
return result != null && (bool) result;
|
|
}
|
|
|
|
//public static async Task<string?> ShowTextFieldDialog(string? msg = null)
|
|
//{
|
|
// var content = msg == null ? new TextFieldDialog() : new TextFieldDialog(msg);
|
|
// var result = await DialogHost.Show(content);
|
|
// return result as string;
|
|
//}
|
|
|
|
#endregion
|
|
|
|
public static async Task<LoginAgainVM?> ShowLoginAgainDialog(string username, string? currentPassword = null)
|
|
{
|
|
var vm = new LoginAgainVM
|
|
{
|
|
UserName = username,
|
|
Password = currentPassword ?? string.Empty,
|
|
SavePassword = PHandler.IsPasswordSet
|
|
};
|
|
var content = new LoginAgainDialog
|
|
{
|
|
DataContext = vm
|
|
};
|
|
var result = await DialogHost.Show(content);
|
|
if (result is true)
|
|
{
|
|
return vm;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static async Task<LoginAgainOnImportVM?> ShowLoginAgainOnImportDialog(Mafile mafile,
|
|
IEnumerable<MaProxy> proxies)
|
|
{
|
|
var vm = new LoginAgainOnImportVM(mafile, proxies);
|
|
var content = new LoginAgainOnImportDialog
|
|
{
|
|
DataContext = vm
|
|
};
|
|
var result = await DialogHost.Show(content);
|
|
if (result is true)
|
|
{
|
|
return vm;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static async Task<bool> ShowProxyManager()
|
|
{
|
|
var vm = new ProxyManagerVM();
|
|
var view = new ProxyManagerView
|
|
{
|
|
DataContext = vm
|
|
};
|
|
await DialogHost.Show(view);
|
|
return vm.AnyChanges;
|
|
}
|
|
|
|
public static void CloseDialog()
|
|
{
|
|
DialogHost.Close(null);
|
|
}
|
|
|
|
public static async Task ShowLinkerDialog()
|
|
{
|
|
var vm = new LinkAccountVM();
|
|
var view = new LinkerView
|
|
{
|
|
DataContext = vm
|
|
};
|
|
await DialogHost.Show(view);
|
|
}
|
|
} |