Skip to content

Commit 645d837

Browse files
authored
Fix: Fixed issue were old tabs briefly displayed when startup was set to 'open new tab' (#16596)
1 parent 9e7f8a1 commit 645d837

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Files.App/App.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ private async void Window_Closed(object sender, WindowEventArgs args)
198198
// Save application state and stop any background activity
199199
IUserSettingsService userSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
200200
StatusCenterViewModel statusCenterViewModel = Ioc.Default.GetRequiredService<StatusCenterViewModel>();
201+
ICommandManager commandManager = Ioc.Default.GetRequiredService<ICommandManager>();
201202

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

211212
// Save the current tab list in case it was overwriten by another instance
212-
AppLifecycleHelper.SaveSessionTabs();
213+
if (userSettingsService.GeneralSettingsService.ContinueLastSessionOnStartUp || userSettingsService.AppSettingsService.RestoreTabsOnStartup)
214+
AppLifecycleHelper.SaveSessionTabs();
215+
else
216+
await commandManager.CloseAllTabs.ExecuteAsync();
213217

214218
if (OutputPath is not null)
215219
{

0 commit comments

Comments
 (0)