Skip to content

Commit

Permalink
On startup, Analogy displays a message box with an error Fix #1942
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Feb 9, 2024
1 parent 0887f35 commit 3708746
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Analogy.UnitTests/Analogy.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<ItemGroup>
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="6.0.0.1" />
<PackageReference Include="Analogy.LogViewer.Serilog" Version="6.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.0" />
</ItemGroup>
Expand Down
13 changes: 7 additions & 6 deletions Analogy/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
return new List<AnalogyChangeLog>
{
new ("V6.0.0 - DevExpress V23.2 #1922", AnalogChangeLogType.None, "Lior Banai", new DateTime(2023, 12, 22), "6.0.0"),
new ("V6.0.0 - [Detailed Message] is always in front of main window #1911", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 12, 15), "6.0.0"),
new ("V6.0.0 - [Detailed Message] Time format is not the same as main window #1901", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 12, 15), "6.0.0"),
new ("V6.0.0 - DevExpress NET8 support - V23.1.7", AnalogChangeLogType.None, "Lior Banai", new DateTime(2023, 12, 15), "6.0.0"),
new ("V6.0.0 - NRE under certain themes. Fix #1899", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 11, 22), "6.0.0"),
new ("V6.0.0 - Add NET8 support. #1875", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2023, 11, 17), "6.0.0"),
new ("V6.0.2 - On startup, Analogy displays a message box with an error #1942", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2024, 02, 09), "6.0.2"),
new ("V6.0.1 - DevExpress V23.2 #1922", AnalogChangeLogType.None, "Lior Banai", new DateTime(2023, 12, 22), "6.0.1"),
new ("V6.0.1 - [Detailed Message] is always in front of main window #1911", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 12, 15), "6.0.1"),
new ("V6.0.1 - [Detailed Message] Time format is not the same as main window #1901", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 12, 15), "6.0.1"),
new ("V6.0.1 - DevExpress NET8 support - V23.1.7", AnalogChangeLogType.None, "Lior Banai", new DateTime(2023, 12, 15), "6.0.1"),
new ("V6.0.1 - NRE under certain themes. Fix #1899", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 11, 22), "6.0.1"),
new ("V6.0.1 - Add NET8 support. #1875", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2023, 11, 17), "6.0.1"),
new ("V5.1.1 - millisecond time is not showing parsed json record. #1866", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2023, 10, 27), "5.1.1.0"),
new ("V5.1.1 - Fix NLog Parser #1862", AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2023, 10, 26), "5.1.1.0"),
new ("V5.1.1 - Add escape key to close detailed Message with Esc key #1865", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2023, 10, 20), "5.1.1.0"),
Expand Down
17 changes: 12 additions & 5 deletions Analogy/Managers/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,26 @@ public UpdateManager(IAnalogyUserSettings settings)
return tagName == null ? null : new Version(tagName.Replace("V", "").Replace("v", ""));
}

public async Task<(bool NewData, Release Release)> CheckVersion(bool forceUpdate)
public async Task<(bool NewData, Release? Release)> CheckVersion(bool forceUpdate)
{
if (!forceUpdate && NextUpdate > DateTime.Now && Settings.LastVersionChecked != null)
{
return (false, Settings.LastVersionChecked);
}

IReadOnlyList<Release>? releases = await Utils.GetReleases();
IReadOnlyList<Release>? releases = (await Utils.GetReleases()).ToList();
LastUpdate = DateTime.Now;
CheckedThisTun = true;
var release = releases.OrderByDescending(r => r.PublishedAt).First();
Settings.LastVersionChecked = release;
return (true, release);
if (releases.Any())
{
var release = releases.OrderByDescending(r => r.PublishedAt).First();
Settings.LastVersionChecked = release;
return (true, release);
}
else
{
return (false, Settings.LastVersionChecked);
}
}

public ReleaseAsset? GetDownloadAsset()
Expand Down

0 comments on commit 3708746

Please sign in to comment.