mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
chore: perform resharper cleanup
This commit is contained in:
@@ -2,7 +2,6 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using AutoUpdaterDotNET;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Microsoft.Win32;
|
||||
using NebulaAuth.Model;
|
||||
using NebulaAuth.Model.Entities;
|
||||
using NebulaAuth.Model.Update;
|
||||
@@ -55,7 +54,7 @@ public static class DialogsController
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the SDA encryption password dialog for unlocking SDA-encrypted mafiles.
|
||||
/// Shows the SDA encryption password dialog for unlocking SDA-encrypted mafiles.
|
||||
/// </summary>
|
||||
/// <returns>The entered password if user clicked OK, otherwise null.</returns>
|
||||
public static async Task<string?> ShowSdaPasswordDialog()
|
||||
@@ -73,6 +72,7 @@ public static class DialogsController
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static async Task<bool> ShowProxyManager()
|
||||
{
|
||||
var vm = new ProxyManagerVM();
|
||||
@@ -163,7 +163,7 @@ public static class DialogsController
|
||||
var content = msg == null ? new ConfirmCancelDialog() : new ConfirmCancelDialog(msg);
|
||||
|
||||
var result = await DialogHost.Show(content);
|
||||
return result != null && (bool)result;
|
||||
return result != null && (bool) result;
|
||||
}
|
||||
|
||||
public static async Task<string?> ShowTextFieldDialog(string? title = null, string? msg = null)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using AutoUpdaterDotNET;
|
||||
using NebulaAuth.Model;
|
||||
using NebulaAuth.Model.Update;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Windows;
|
||||
using AutoUpdaterDotNET;
|
||||
using NebulaAuth.Model;
|
||||
using NebulaAuth.Model.Update;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NebulaAuth.Core;
|
||||
|
||||
@@ -13,6 +13,7 @@ public static class UpdateManager
|
||||
{
|
||||
private const string BASE_URL =
|
||||
"https://raw.githubusercontent.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/master/";
|
||||
|
||||
private const string UPDATE_URL = BASE_URL + "NebulaAuth/update.xml";
|
||||
|
||||
private const string CHANGELOG_BASE_URL = BASE_URL + "changelog/";
|
||||
@@ -21,13 +22,14 @@ public static class UpdateManager
|
||||
private static bool _isManualCheck;
|
||||
|
||||
public static bool HasPendingUpdate { get; private set; }
|
||||
public static event Action? PendingUpdateDetected;
|
||||
|
||||
static UpdateManager()
|
||||
{
|
||||
AutoUpdater.CheckForUpdateEvent += HandleCheckForUpdateEvent;
|
||||
}
|
||||
|
||||
public static event Action? PendingUpdateDetected;
|
||||
|
||||
public static void CheckForUpdates(bool manual = false)
|
||||
{
|
||||
_isManualCheck = manual;
|
||||
@@ -62,7 +64,8 @@ public static class UpdateManager
|
||||
if (isManual)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
SnackbarController.SendSnackbar(LocManager.GetCommonOrDefault("Request error", "RequestError")));
|
||||
SnackbarController.SendSnackbar(LocManager.GetCommonOrDefault("Request error",
|
||||
"RequestError")));
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -81,7 +84,7 @@ public static class UpdateManager
|
||||
return;
|
||||
}
|
||||
|
||||
var version = args.CurrentVersion.ToString();
|
||||
var version = args.CurrentVersion;
|
||||
var settings = UpdateSettings.Load();
|
||||
|
||||
if (!isManual && !settings.ShouldShow(version))
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using NebulaAuth.Core;
|
||||
using NebulaAuth.Model;
|
||||
using NebulaAuth.View.Dialogs;
|
||||
using NebulaAuth.ViewModel;
|
||||
using NebulaAuth.ViewModel.Other;
|
||||
using System;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -13,6 +7,12 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Threading;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using NebulaAuth.Core;
|
||||
using NebulaAuth.Model;
|
||||
using NebulaAuth.View.Dialogs;
|
||||
using NebulaAuth.ViewModel;
|
||||
using NebulaAuth.ViewModel.Other;
|
||||
|
||||
namespace NebulaAuth;
|
||||
|
||||
@@ -55,12 +55,13 @@ public partial class MainWindow
|
||||
|
||||
private static ColorAnimationUsingKeyFrames BuildBlinkAnimation(Duration duration, string targetName)
|
||||
{
|
||||
var anim = new ColorAnimationUsingKeyFrames { Duration = duration };
|
||||
var anim = new ColorAnimationUsingKeyFrames {Duration = duration};
|
||||
for (var i = 0; i <= 6; i++)
|
||||
{
|
||||
var color = i % 2 == 0 ? Colors.DodgerBlue : Colors.OrangeRed;
|
||||
anim.KeyFrames.Add(new DiscreteColorKeyFrame(color, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(i))));
|
||||
}
|
||||
|
||||
Storyboard.SetTargetName(anim, targetName);
|
||||
Storyboard.SetTargetProperty(anim, new PropertyPath(SolidColorBrush.ColorProperty));
|
||||
return anim;
|
||||
|
||||
@@ -51,7 +51,7 @@ public static class Storage
|
||||
await Task.Run(() =>
|
||||
{
|
||||
return Parallel.ForEachAsync(files,
|
||||
new ParallelOptions { CancellationToken = token, MaxDegreeOfParallelism = threadCount },
|
||||
new ParallelOptions {CancellationToken = token, MaxDegreeOfParallelism = threadCount},
|
||||
async (file, ct) =>
|
||||
{
|
||||
try
|
||||
@@ -241,7 +241,7 @@ public static class Storage
|
||||
|
||||
if (counter % 5 == 0)
|
||||
{
|
||||
progress?.Report(counter / (double)files.Count);
|
||||
progress?.Report(counter / (double) files.Count);
|
||||
await Task.Delay(10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ public static class SDAEncryptionHelper
|
||||
if (string.IsNullOrWhiteSpace(fileName))
|
||||
return null;
|
||||
|
||||
var entries = sdaManifest.Entries.ToDictionary(x => Path.GetFileName(x.Filename), StringComparer.OrdinalIgnoreCase);
|
||||
var entries =
|
||||
sdaManifest.Entries.ToDictionary(x => Path.GetFileName(x.Filename), StringComparer.OrdinalIgnoreCase);
|
||||
return new Context(sdaManifest, entries, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,8 @@ public static class SDAEncryptor
|
||||
}
|
||||
}
|
||||
|
||||
public static bool TryDecryptData(string password, string passwordSalt, string IV, string encryptedData, [NotNullWhen(true)] out string? plaintext)
|
||||
public static bool TryDecryptData(string password, string passwordSalt, string IV, string encryptedData,
|
||||
[NotNullWhen(true)] out string? plaintext)
|
||||
{
|
||||
plaintext = null;
|
||||
try
|
||||
|
||||
@@ -5,24 +5,18 @@ namespace NebulaAuth.Model.Update;
|
||||
|
||||
public class ChangelogEntry
|
||||
{
|
||||
[JsonProperty("version")]
|
||||
public string Version { get; set; } = string.Empty;
|
||||
[JsonProperty("version")] public string Version { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("date")]
|
||||
public string Date { get; set; } = string.Empty;
|
||||
[JsonProperty("date")] public string Date { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("changes")]
|
||||
public List<ChangeItem> Changes { get; set; } = new();
|
||||
[JsonProperty("changes")] public List<ChangeItem> Changes { get; set; } = new();
|
||||
}
|
||||
|
||||
public class ChangeItem
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
[JsonProperty("type")] public string Type { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; } = string.Empty;
|
||||
[JsonProperty("text")] public string Text { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("link")]
|
||||
public string? Link { get; set; }
|
||||
}
|
||||
[JsonProperty("link")] public string? Link { get; set; }
|
||||
}
|
||||
@@ -8,11 +8,9 @@ public class UpdateSettings
|
||||
{
|
||||
private static readonly string FilePath = Path.Combine("settings", "update.json");
|
||||
|
||||
[JsonProperty("skippedVersion")]
|
||||
public string? SkippedVersion { get; set; }
|
||||
[JsonProperty("skippedVersion")] public string? SkippedVersion { get; set; }
|
||||
|
||||
[JsonProperty("remindAfter")]
|
||||
public DateTime? RemindAfter { get; set; }
|
||||
[JsonProperty("remindAfter")] public DateTime? RemindAfter { get; set; }
|
||||
|
||||
public static UpdateSettings Load()
|
||||
{
|
||||
@@ -56,4 +54,4 @@ public class UpdateSettings
|
||||
if (RemindAfter.HasValue && DateTime.Now < RemindAfter.Value) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
throwExceptions="true">
|
||||
|
||||
<targets>
|
||||
<target xsi:type="File"
|
||||
name="File"
|
||||
fileName="${basedir}/logs/log-${shortdate}.log"
|
||||
concurrentWrites="true"
|
||||
keepFileOpen="false">
|
||||
<target xsi:type="File"
|
||||
name="File"
|
||||
fileName="${basedir}/logs/log-${shortdate}.log"
|
||||
concurrentWrites="true"
|
||||
keepFileOpen="false">
|
||||
<layout xsi:type='CompoundLayout'>
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" IncludeScopeProperties="true">
|
||||
<attribute name="time" layout="${longdate}" />
|
||||
|
||||
@@ -174,7 +174,8 @@
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type entities:MarketMultiConfirmation}">
|
||||
<Expander Padding="0" Background="Transparent" materialDesign:ExpanderAssist.ExpanderButtonPosition="Start" materialDesign:ExpanderAssist.HorizontalHeaderPadding="0" HorizontalAlignment="Stretch">
|
||||
<Expander Padding="0" Background="Transparent" materialDesign:ExpanderAssist.ExpanderButtonPosition="Start"
|
||||
materialDesign:ExpanderAssist.HorizontalHeaderPadding="0" HorizontalAlignment="Stretch">
|
||||
<Expander.Header>
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -236,7 +237,7 @@
|
||||
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding ItemName}" />
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Left"
|
||||
|
||||
@@ -68,4 +68,4 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -6,4 +6,4 @@ public partial class SdaPasswordDialog
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,57 +57,62 @@
|
||||
|
||||
<!-- JSON changelog items -->
|
||||
<materialDesign:Card Grid.Row="1" Padding="10">
|
||||
<ScrollViewer MaxHeight="350" VerticalScrollBarVisibility="Auto"
|
||||
Visibility="{Binding HasJsonChangelog, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ItemsControl ItemsSource="{Binding Changelog.Changes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,6,0,6">
|
||||
<Border CornerRadius="3" Padding="4,2,4,2" Margin="0,0,8,0"
|
||||
VerticalAlignment="Center">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Type}" Value="NEW">
|
||||
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="FIX">
|
||||
<Setter Property="Background" Value="{DynamicResource WarningBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="IMPROVEMENT">
|
||||
<Setter Property="Background" Value="{DynamicResource AccentBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="SECURITY">
|
||||
<Setter Property="Background" Value="{DynamicResource ErrorBrush}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="{Binding Type}" FontSize="11" FontWeight="Bold"
|
||||
Foreground="White" />
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" TextWrapping="Wrap"
|
||||
VerticalAlignment="Center" FontSize="14" MaxWidth="420" />
|
||||
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||
Width="20" Height="20"
|
||||
Padding="2"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding DataContext.OpenLinkCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
CommandParameter="{Binding Link}"
|
||||
ToolTip="Open Link"
|
||||
Visibility="{Binding Link, Converter={StaticResource NullableToVisibilityConverter}}">
|
||||
<materialDesign:PackIcon Kind="OpenInNew" Width="14" Height="14" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Separator Opacity="0.2" Margin="0,2,0,2"/>
|
||||
</StackPanel>
|
||||
<ScrollViewer MaxHeight="350" VerticalScrollBarVisibility="Auto"
|
||||
Visibility="{Binding HasJsonChangelog, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ItemsControl ItemsSource="{Binding Changelog.Changes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,6,0,6">
|
||||
<Border CornerRadius="3" Padding="4,2,4,2" Margin="0,0,8,0"
|
||||
VerticalAlignment="Center">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Type}" Value="NEW">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource SuccessBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="FIX">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource WarningBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="IMPROVEMENT">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource AccentBrush}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Type}" Value="SECURITY">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ErrorBrush}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="{Binding Type}" FontSize="11" FontWeight="Bold"
|
||||
Foreground="White" />
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" TextWrapping="Wrap"
|
||||
VerticalAlignment="Center" FontSize="14" MaxWidth="420" />
|
||||
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||
Width="20" Height="20"
|
||||
Padding="2"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding DataContext.OpenLinkCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
CommandParameter="{Binding Link}"
|
||||
ToolTip="Open Link"
|
||||
Visibility="{Binding Link, Converter={StaticResource NullableToVisibilityConverter}}">
|
||||
<materialDesign:PackIcon Kind="OpenInNew" Width="14" Height="14" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Separator Opacity="0.2" Margin="0,2,0,2" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</materialDesign:Card>
|
||||
<!-- No changelog fallback -->
|
||||
<TextBlock Grid.Row="1" Text="{Tr UpdateDialog.NoChangelog}" FontSize="13" Opacity="0.6"
|
||||
@@ -118,7 +123,8 @@
|
||||
<Grid Grid.Row="3" Margin="12,6,12,14">
|
||||
|
||||
<!-- Normal buttons -->
|
||||
<StackPanel Visibility="{Binding ShowRemindOptions, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
|
||||
<StackPanel
|
||||
Visibility="{Binding ShowRemindOptions, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
|
||||
<Button Style="{StaticResource MaterialDesignRaisedButton}"
|
||||
Command="{Binding UpdateNowCommand}"
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -141,7 +147,8 @@
|
||||
</StackPanel>
|
||||
|
||||
<!-- Remind later options -->
|
||||
<StackPanel Visibility="{Binding ShowRemindOptions, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<StackPanel
|
||||
Visibility="{Binding ShowRemindOptions, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Text="{Tr UpdateDialog.RemindAfter}" Margin="0,0,0,8" FontSize="14" />
|
||||
<WrapPanel>
|
||||
<Button Style="{StaticResource MaterialDesignOutlinedButton}" Margin="0,0,4,4"
|
||||
@@ -169,4 +176,4 @@
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -6,4 +6,4 @@ public partial class UpdateDialog
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using NebulaAuth.Core;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using NebulaAuth.Core;
|
||||
|
||||
namespace NebulaAuth.View;
|
||||
|
||||
@@ -37,6 +37,6 @@ public partial class LinksView : UserControl
|
||||
private void CheckForUpdates_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogHost.Close(null);
|
||||
UpdateManager.CheckForUpdates(manual: true);
|
||||
UpdateManager.CheckForUpdates(true);
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public partial class MainVM : ObservableObject
|
||||
new MaProxy(kvp.Key, kvp.Value)));
|
||||
Storage.MaFiles.CollectionChanged += MaFilesOnCollectionChanged;
|
||||
QueryGroups();
|
||||
UpdateManager.CheckForUpdates(manual: false);
|
||||
UpdateManager.CheckForUpdates(false);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -70,7 +70,6 @@ public partial class MainVM : ObservableObject
|
||||
ConfirmLoginCommand.NotifyCanExecuteChanged();
|
||||
RemoveProxyCommand.NotifyCanExecuteChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ public partial class MainVM //Confirmations
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task SendConfirmation(Mafile mafile, Confirmation confirmation, bool confirm)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -82,7 +82,7 @@ public partial class MainVM
|
||||
private bool RemoveProxyCanExecute(Mafile? mafile)
|
||||
{
|
||||
mafile ??= SelectedMafile;
|
||||
return mafile is { Proxy: not null };
|
||||
return mafile is {Proxy: not null};
|
||||
}
|
||||
|
||||
private void CheckProxyExist()
|
||||
|
||||
@@ -4,9 +4,8 @@ namespace NebulaAuth.ViewModel.Other;
|
||||
|
||||
public partial class SdaPasswordDialogVM : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsFormValid))]
|
||||
private string _password = string.Empty;
|
||||
|
||||
public bool IsFormValid => !string.IsNullOrWhiteSpace(Password);
|
||||
}
|
||||
|
||||
[ObservableProperty] [NotifyPropertyChangedFor(nameof(IsFormValid))]
|
||||
private string _password = string.Empty;
|
||||
}
|
||||
@@ -20,8 +20,7 @@ public partial class SettingsVM : ObservableObject
|
||||
|
||||
[ObservableProperty] private string? _renameResultText;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(ApplyRenameSettingCommand))]
|
||||
[ObservableProperty] [NotifyCanExecuteChangedFor(nameof(ApplyRenameSettingCommand))]
|
||||
private bool _useAccountNameAsMafileNamePreview;
|
||||
|
||||
public SettingsVM()
|
||||
|
||||
@@ -5,6 +5,7 @@ using AutoUpdaterDotNET;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using NebulaAuth.Core;
|
||||
using NebulaAuth.Model.Update;
|
||||
|
||||
namespace NebulaAuth.ViewModel.Other;
|
||||
@@ -14,7 +15,7 @@ public partial class UpdateDialogVM : ObservableObject
|
||||
public UpdateInfoEventArgs Args { get; }
|
||||
public ChangelogEntry? Changelog { get; }
|
||||
public string? HtmlFallbackUrl { get; }
|
||||
public string Version => Args.CurrentVersion.ToString();
|
||||
public string Version => Args.CurrentVersion;
|
||||
public bool HasJsonChangelog => Changelog?.Changes?.Count > 0;
|
||||
|
||||
[ObservableProperty] private bool _showRemindOptions;
|
||||
@@ -53,14 +54,14 @@ public partial class UpdateDialogVM : ObservableObject
|
||||
"7D" => TimeSpan.FromDays(7),
|
||||
_ => TimeSpan.FromDays(1)
|
||||
};
|
||||
Core.UpdateManager.SetRemindAfter(delay);
|
||||
UpdateManager.SetRemindAfter(delay);
|
||||
DialogHost.Close(null);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void SkipVersion()
|
||||
{
|
||||
Core.UpdateManager.SkipVersion(Version);
|
||||
UpdateManager.SkipVersion(Version);
|
||||
DialogHost.Close(null);
|
||||
}
|
||||
|
||||
@@ -68,6 +69,6 @@ public partial class UpdateDialogVM : ObservableObject
|
||||
private void OpenLink(string url)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url)) return;
|
||||
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
|
||||
Process.Start(new ProcessStartInfo(url) {UseShellExecute = true});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user