Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where old tabs briefly displayed when startup was set to 'open new tab' #16596

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading