Skip to content

Commit

Permalink
Fix: Fixed issue were old tabs briefly displayed when startup was set…
Browse files Browse the repository at this point in the history
… to 'open new tab' (files-community#16596)
  • Loading branch information
yaira2 authored Dec 15, 2024
1 parent 9e7f8a1 commit 645d837
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ private async void Window_Closed(object sender, WindowEventArgs args)
// Save application state and stop any background activity
IUserSettingsService userSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
StatusCenterViewModel statusCenterViewModel = Ioc.Default.GetRequiredService<StatusCenterViewModel>();
ICommandManager commandManager = Ioc.Default.GetRequiredService<ICommandManager>();

// A Workaround for the crash (#10110)
if (_LastOpenedFlyout?.IsOpen ?? false)
Expand All @@ -209,7 +210,10 @@ private async void Window_Closed(object sender, WindowEventArgs args)
}

// Save the current tab list in case it was overwriten by another instance
AppLifecycleHelper.SaveSessionTabs();
if (userSettingsService.GeneralSettingsService.ContinueLastSessionOnStartUp || userSettingsService.AppSettingsService.RestoreTabsOnStartup)
AppLifecycleHelper.SaveSessionTabs();
else
await commandManager.CloseAllTabs.ExecuteAsync();

if (OutputPath is not null)
{
Expand Down

0 comments on commit 645d837

Please sign in to comment.