1.5.3 progress.

- Fixed CantLoadConfirmationsException was intercepted by error monitor
- Added localization to CantLoadConfirmationsException in ErrorHandler
- Added Copy RCode button to the Link dialog
- Fixed tooltips were messed up on Trade/Market timer's buttons
This commit is contained in:
Давид Чернопятов
2024-10-21 13:32:45 +03:00
parent 1e65cd4a06
commit acf187fc6b
9 changed files with 78 additions and 25 deletions
+2 -2
View File
@@ -127,10 +127,10 @@
</UIElement.Visibility>
</md:PackIcon>
<md:PackIcon Kind="StopAlert" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FFFFA500" Margin="3" ToolTip="{Tr MainWindow.AppBar.Proxy.ProxyAlert.DefaultInUse}" ToolTipService.InitialShowDelay="300" Visibility="{Binding IsDefaultProxy, Converter={StaticResource BooleanToVisibilityConverter}}" />
<ToggleButton ToolTip="{Tr MainWindow.AppBar.TradeTimerHint}" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" IsEnabled="{Binding IsMafileSelected}" Margin="2" Style="{StaticResource MaterialDesignFlatToggleButton}" IsChecked="{Binding MarketTimerEnabled}" >
<ToggleButton ToolTip="{Tr MainWindow.AppBar.MarketTimerHint}" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" IsEnabled="{Binding IsMafileSelected}" Margin="2" Style="{StaticResource MaterialDesignFlatToggleButton}" IsChecked="{Binding MarketTimerEnabled}" >
<md:PackIcon Kind="ShoppingCart"/>
</ToggleButton>
<ToggleButton ToolTip="{Tr MainWindow.AppBar.MarketTimerHint}" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" IsEnabled="{Binding IsMafileSelected}" Margin="2" Style="{StaticResource MaterialDesignFlatToggleButton}" IsChecked="{Binding TradeTimerEnabled}" >
<ToggleButton ToolTip="{Tr MainWindow.AppBar.TradeTimerHint}" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" IsEnabled="{Binding IsMafileSelected}" Margin="2" Style="{StaticResource MaterialDesignFlatToggleButton}" IsChecked="{Binding TradeTimerEnabled}" >
<md:PackIcon Kind="AccountArrowRight" />
</ToggleButton>
<TextBox md:HintAssist.Hint="{Tr Common.Abbreviations.Time.Seconds}" Margin="10,0,0,0" MinWidth="30" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding TimerCheckSeconds, UpdateSourceTrigger=PropertyChanged, Delay=700}" PreviewTextInput="UIElement_OnPreviewTextInput" />
+12 -1
View File
@@ -6,6 +6,7 @@ using SteamLib.ProtoCore.Exceptions;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Windows.Input;
namespace NebulaAuth.Utility;
@@ -60,7 +61,17 @@ public static class ExceptionHandler
}
case CantLoadConfirmationsException e:
{
msg = e.Message;
msg = LocManager.GetCodeBehindOrDefault(nameof(CantLoadConfirmationsException), EXCEPTION_HANDLER_LOC_PATH, nameof(CantLoadConfirmationsException), "Common");
if (e.Error == LoadConfirmationsError.Unknown)
{
msg += e.ErrorMessage;
msg += ' ';
msg += e.ErrorDetails;
}
else
{
msg += LocManager.GetCodeBehindOrDefault(e.Error.ToString(), EXCEPTION_HANDLER_LOC_PATH, nameof(CantLoadConfirmationsException), e.Error.ToString());
}
break;
}
case EResultException e:
+11 -1
View File
@@ -129,7 +129,17 @@
<TextBlock Text="{Tr LinkerDialog.Message}" FontSize="16" Foreground="GhostWhite"/>
</DataTemplate>
</GroupBox.HeaderTemplate>
<TextBlock Foreground="GhostWhite" FontSize="16" Text="{Binding HintText}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Foreground="GhostWhite" FontSize="16" Text="{Binding HintText}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
<Button Command="{Binding CopyCodeCommand}" Visibility="{Binding IsCompleted, Converter={StaticResource BooleanToVisibilityConverter}}" Grid.Row="1">
<materialDesign:PackIcon Kind="ContentCopy" />
</Button>
</Grid>
</GroupBox>
</Grid>
+18 -1
View File
@@ -62,7 +62,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
private TaskCompletionSource<string> _linkCodeTcs = new();
private bool _isLinkStarted;
private string _rCode = string.Empty;
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(ProceedCommand))]
private bool _canProceed = true;
@@ -199,6 +199,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
mafile.RevocationCode,
mafile.SessionData?.SteamId.Steam64);
_rCode = mafile.RevocationCode ?? string.Empty;
CanProceed = true;
return;
}
@@ -318,6 +319,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
IsEmailConfirmation = false;
CanProceed = true;
_emailCodeTcs = new TaskCompletionSource<string>();
_rCode = string.Empty;
}
private void Backup(MobileDataExtended data)
@@ -415,6 +417,21 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
});
}
[RelayCommand]
private void CopyCode()
{
try
{
Clipboard.SetText(_rCode);
}
catch (Exception ex)
{
Shell.Logger.Error(ex, "Error whily copying RCode");
return;
}
}
private static string GetLocalizationOrDefault(string key)
{
return LocManager.GetCodeBehindOrDefault(key, LOCALIZATION_KEY, key);
+21 -4
View File
@@ -73,7 +73,7 @@
"ru": "Чтобы начать пользоваться программой вы можете привязать аккаунт через меню \"Аккаунт\", либо импортировать существующие мафайлы одним из способов:\n1. Скопировать их в папку mafiles и перезапустить приложение\n2. Перетянуть файлы прямо в окно программы\n3. Скопировать файлы и нажать CTRL+V в окне программы\n4. Через меню \"Файл\" - \"Импорт\"",
"en": "To start using the program, you can link an account through the \"Account\" menu, or import existing mafiles in one of the following ways:\n1. Copy them to the mafiles folder and restart the application\n2. Drag files directly into the program window\n3. Copy files and press CTRL+V in the program window\n4. Through the \"File\" - \"Import\" menu",
"ua": "Щоб почати користуватися програмою, ви можете прив'язати акаунт через меню \"Акаунт\", або імпортувати існуючі мафайли одним із способів:\n1. Скопіювати їх у папку mafiles та перезапустити програму\n2. Перетягнути файли безпосередньо в вікно програми\n3. Скопіювати файли та натиснути CTRL+V в вікні програми\n4. Через меню \"Файл\" - \"Імпорт\""
}
}
},
"Menu": {
"File": {
@@ -403,7 +403,7 @@
"en": "Press 'DEL' to remove",
"ru": "Нажмите 'DEL' для удаления",
"ua": "Натисніть 'DEL' для видалення"
}
}
},
"ProxyManagerDialog": {
"Title": {
@@ -634,7 +634,7 @@
"en": "Login copied",
"ru": "Логин скопирован",
"ua": "Логін скопійовано"
}
}
},
"ErrorTranslator": {
"Login": {
@@ -928,6 +928,23 @@
"ru": "Неизвестная ошибка: ",
"en": "Unknown error: ",
"ua": "Невідома помилка: "
},
"CantLoadConfirmationsException": {
"Common": {
"ru": "Не удалось загрузить потверждения из-за ошибки Steam: ",
"en": "Can't load confirmations due to Steam error: ",
"ua": "Не вдалося завантажити підтвердження через помилку Steam: "
},
"TryAgainLater": {
"ru": "Попробуйте позже",
"en": "Try again later",
"ua": "Спробуйте пізніше"
},
"NotSetupToReceiveConfirmations": {
"ru": "Аккаунт не настроен на получение подтверждений",
"en": "Account is not set up to receive confirmations",
"ua": "Акаунт не налаштований на отримання підтверджень"
}
}
},
@@ -1038,7 +1055,7 @@
"en": "Auto ",
"ua": "Авто "
}
}
}
},
"CantAlignTimeError": {
"ru": "Не удается синхронизировать время со Steam. Возможно отсутствует подключение к интернету или Steam недоступен. Подробная ошибка сохранена в log.log",
@@ -41,11 +41,10 @@ public static class SteamMobileConfirmationsApi
return MobileConfirmationScrapper.Scrap(respStr);
}
catch (Exception ex)
when (ex is not SessionPermanentlyExpiredException)
when (ex is not (SessionPermanentlyExpiredException or CantLoadConfirmationsException))
{
var e = new UnsupportedResponseException(respStr, ex);
SteamLibErrorMonitor.LogErrorResponse(respStr, e);
throw e;
SteamLibErrorMonitor.LogErrorResponse(respStr, ex);
throw;
}
}
@@ -4,6 +4,8 @@
public class CantLoadConfirmationsException : Exception
{
public LoadConfirmationsError Error { get; init; }
public string? ErrorMessage { get; init; }
public string? ErrorDetails { get; init; }
public CantLoadConfirmationsException() { }
public CantLoadConfirmationsException(string message) : base(message) { }
public CantLoadConfirmationsException(string message, Exception inner) : base(message, inner) { }
@@ -31,24 +31,20 @@ public static class MobileConfirmationScrapper
throw new SessionPermanentlyExpiredException();
}
if (conf is {Success: false, Message: not null})
if (conf.Success == false)
{
var error = LoadConfirmationsError.Unknown;
if (ErrorMessages.TryGetValue(conf.Message, out var e))
if (conf.Message != null && ErrorMessages.TryGetValue(conf.Message, out var e))
{
error = e;
}
throw new CantLoadConfirmationsException(conf.Message)
throw new CantLoadConfirmationsException("Error while loading confirmations")
{
Error = error
Error = error,
ErrorMessage = conf.Message,
ErrorDetails = conf.Detail
};
}
if (conf.Success == false)
{
throw new UnsupportedResponseException(response);
}
+3 -2
View File
@@ -72,11 +72,12 @@
- NEWS: Official telegram group created. Join us at <a href="https://t.me/nebulaauth">t.me/nebulaauth</a> <br />
- UPDATE: Auto-confirmation was reworked. Now every account has separate timer settings <br />
- UPDATE: Added hyperlink to troubleshooting guide in "Linking" window <br />
- UPDATE: Added "switch auto-confirm view" button that shows enabled aut-confirm accounts<br />
- UPDATE: Added socks4, socks5 proxy support (not tested) <br />
- FIX: Now errors in receiving confirmations are localized and displayed correctly. <br/>
- UI: Added "Copy RCode" button after linking account <br />
- UI: Auto-confirm timers now use icons instead of text-chips <br />
- UI: Minor design and localization improvements <br />
- UI: Hyperlink "by achies" now leads to "achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies" instead of "achiez/"<br />
- UI: Hyperlink "by achies" now leads to repository instead of "achiez/" user page<br />
- DEV: Big code clean-ups and refactoring <br />
- DEV: Updated dependency and SteamLib libraries <br />
</div>