Skip to content

Commit 172931f

Browse files
committed
Code Quality: Fixed issue where release notes tab kept opening
1 parent aa7d7fa commit 172931f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Files.App/Helpers/Application/AppLifecycleHelper.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public static class AppLifecycleHelper
4242
/// </summary>
4343
public static long TotalLaunchCount { get; }
4444

45+
/// <summary>
46+
/// Gets the value that indicates if the release notes tab was automatically opened.
47+
/// </summary>
48+
private static bool ViewedReleaseNotes { get; set; } = false;
49+
4550
static AppLifecycleHelper()
4651
{
4752
using var infoKey = Registry.CurrentUser.CreateSubKey(AppInformationKey);
@@ -137,8 +142,14 @@ public static async Task CheckAppUpdate()
137142
await updateService.CheckForReleaseNotesAsync();
138143

139144
// Check for release notes before checking for new updates
140-
if (AppEnvironment != AppEnvironment.Dev && IsAppUpdated && updateService.AreReleaseNotesAvailable)
145+
if (AppEnvironment != AppEnvironment.Dev &&
146+
IsAppUpdated &&
147+
updateService.AreReleaseNotesAvailable &&
148+
!ViewedReleaseNotes)
149+
{
141150
await Ioc.Default.GetRequiredService<ICommandManager>().OpenReleaseNotes.ExecuteAsync();
151+
ViewedReleaseNotes = true;
152+
}
142153

143154
await updateService.CheckForUpdatesAsync();
144155
await updateService.DownloadMandatoryUpdatesAsync();

0 commit comments

Comments
 (0)