From 513ff45cc4303b855dab6d89f06161ae85891643 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:46:56 +0900 Subject: [PATCH] Update App.xaml.cs --- src/Files.App/App.xaml.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Files.App/App.xaml.cs b/src/Files.App/App.xaml.cs index 0ca6dcc706c1..56361f23800a 100644 --- a/src/Files.App/App.xaml.cs +++ b/src/Files.App/App.xaml.cs @@ -206,6 +206,8 @@ private async void Window_Closed(object sender, WindowEventArgs args) return; } + AppLifecycleHelper.SaveSessionTabs(); + // Continue running the app on the background if (userSettingsService.GeneralSettingsService.LeaveAppRunning && !AppModel.ForceProcessTermination && @@ -220,8 +222,7 @@ private async void Window_Closed(object sender, WindowEventArgs args) // Cache the window instead of closing it MainWindow.Instance.AppWindow.Hide(); - // Save and close all tabs - AppLifecycleHelper.SaveSessionTabs(); + // Close all tabs MainPageViewModel.AppInstances.ForEach(tabItem => tabItem.Unload()); MainPageViewModel.AppInstances.Clear(); @@ -251,8 +252,6 @@ private async void Window_Closed(object sender, WindowEventArgs args) // Method can take a long time, make sure the window is hidden await Task.Yield(); - AppLifecycleHelper.SaveSessionTabs(); - if (OutputPath is not null) { await SafetyExtensions.IgnoreExceptions(async () =>