Skip to content

Commit 220fbe7

Browse files
committed
fix: #716
1 parent 663bc07 commit 220fbe7

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

Ui/AppVersion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ public static class AppVersion
66
{
77
public const uint Major = 1;
88
public const uint Minor = 0;
9-
public const uint Patch = 0;
9+
public const uint Patch = 1;
1010
public const uint Build = 0;
1111
public const string BuildDate = "";
12-
public const string PreRelease = ""; // e.g. "alpha" "beta.2"
12+
public const string PreRelease = "alpha"; // e.g. "alpha" "beta.2"
1313

1414
public static readonly Version VersionData = new Version(Major, Minor, Patch, Build, PreRelease);
1515
public static string Version => VersionData.ToString();

Ui/Ui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</PropertyGroup>
7474

7575
<PropertyGroup>
76-
<AssemblyVersion>1.0.0.40905</AssemblyVersion>
76+
<AssemblyVersion>1.0.0.40919</AssemblyVersion>
7777
<FileVersion>$(AssemblyVersion)</FileVersion>
7878
<Version>$(AssemblyVersion)</Version>
7979
<Authors>Shawn</Authors>

Ui/View/AboutPageViewModel.cs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Security.Policy;
45
using System.Text.RegularExpressions;
@@ -43,21 +44,27 @@ private static VersionHelper.CheckUpdateResult CustomCheckMethod(string html, st
4344
if (ret.NewerPublished)
4445
return ret;
4546

46-
var mc = Regex.Matches(html, @".?1remote-([\d|\.]*.*)-net6", RegexOptions.IgnoreCase);
47-
if (mc.Count > 0)
47+
var patterns = new List<string>()
4848
{
49-
var versionString = mc[mc.Count - 1].Groups[1].Value;
50-
var releasedVersion = VersionHelper.Version.FromString(versionString);
51-
if (ignoreVersion is not null)
52-
{
53-
if (releasedVersion <= ignoreVersion)
54-
{
55-
return VersionHelper.CheckUpdateResult.False();
56-
}
57-
}
58-
if (releasedVersion > currentVersion)
59-
return new VersionHelper.CheckUpdateResult(true, versionString, publishUrl, versionString.FirstOrDefault() == '!' || versionString.LastOrDefault() == '!');
60-
}
49+
@".?1remote-([\d|\.]*.*)-net",
50+
@".?latest\sversion:\s*([\d|.]*)",
51+
};
52+
foreach (var pattern in patterns)
53+
{
54+
var mc = Regex.Matches(html, pattern, RegexOptions.IgnoreCase);
55+
if (mc.Count <= 0) continue;
56+
var versionString = mc[^1].Groups[1].Value;
57+
var releasedVersion = VersionHelper.Version.FromString(versionString);
58+
if (ignoreVersion is not null)
59+
{
60+
if (releasedVersion <= ignoreVersion)
61+
{
62+
return VersionHelper.CheckUpdateResult.False();
63+
}
64+
}
65+
if (releasedVersion > currentVersion)
66+
return new VersionHelper.CheckUpdateResult(true, versionString, publishUrl, versionString.FirstOrDefault() == '!' || versionString.LastOrDefault() == '!');
67+
}
6168
return VersionHelper.CheckUpdateResult.False();
6269
}
6370

Ui/View/Editor/Forms/SshFormView.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,24 @@ public SshFormView() : base()
1919
{
2020
if (DataContext is SshFormViewModel { New: var ssh })
2121
{
22-
CbUsePrivateKey.IsChecked = false;
22+
bool? privateKey = false;
2323
if (ssh.PrivateKey == ssh.ServerEditorDifferentOptions)
2424
{
2525
CbUsePrivateKey.IsChecked = null;
26+
privateKey = null;
27+
2628
}
2729

2830
if (!string.IsNullOrEmpty(ssh.PrivateKey))
2931
{
3032
CbUsePrivateKey.IsChecked = true;
33+
privateKey = true;
34+
3135
}
36+
37+
CbUsePrivateKey.IsChecked = privateKey;
3238
}
33-
};
39+
};
3440
}
3541

3642
private void ButtonOpenPrivateKey_OnClick(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)