From e3f3ba087c8a41c6a33b27ebe505cd0c12185075 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Tue, 10 Dec 2024 21:15:33 -0500 Subject: [PATCH] Fix: Fixed issue were old tabs briefly displayed when startup was set to 'open new tab' --- src/Files.App/App.xaml.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Files.App/App.xaml.cs b/src/Files.App/App.xaml.cs index 8e77a1fd51d4..8a64719ac069 100644 --- a/src/Files.App/App.xaml.cs +++ b/src/Files.App/App.xaml.cs @@ -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(); StatusCenterViewModel statusCenterViewModel = Ioc.Default.GetRequiredService(); + ICommandManager commandManager = Ioc.Default.GetRequiredService(); // A Workaround for the crash (#10110) if (_LastOpenedFlyout?.IsOpen ?? false) @@ -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) {