Skip to content

Commit 7674bd0

Browse files
committed
Update ReleaseNotesService.cs
1 parent 00f4797 commit 7674bd0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Files.App/ServicesImplementation/ReleaseNotesService.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Collections.Generic;
88
using System.IO;
99
using System.Linq;
10+
using System.Net.Http;
1011
using System.Threading.Tasks;
1112
using Windows.Services.Store;
1213
using WinRT.Interop;
@@ -31,7 +32,20 @@ public bool IsReleaseNotesAvailable
3132

3233
public async Task DownloadReleaseNotes()
3334
{
34-
///
35+
var applicationVersion = $"{SystemInformation.Instance.ApplicationVersion.Major}.{SystemInformation.Instance.ApplicationVersion.Minor}.{SystemInformation.Instance.ApplicationVersion.Build}";
36+
var releaseNotesLocation = string.Concat("https://raw.githubusercontent.com/files-community/Files/main/", applicationVersion, ".md");
37+
38+
using (var client = new HttpClient())
39+
{
40+
try
41+
{
42+
ReleaseNotes = await client.GetStringAsync(releaseNotesLocation);
43+
}
44+
catch { }
45+
}
46+
47+
if (!string.IsNullOrWhiteSpace(ReleaseNotes))
48+
IsReleaseNotesAvailable = true;
3549
}
3650
}
3751
}

0 commit comments

Comments
 (0)