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 exiting from the system tray icon didn't save the tabs #14496

Merged
merged 1 commit into from
Jan 21, 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
7 changes: 3 additions & 4 deletions src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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();

Expand Down Expand Up @@ -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 () =>
Expand Down