Skip to content

Commit 5b5cb85

Browse files
authored
Several fixes for continue where you left off (#1792)
1 parent 1eb8a2d commit 5b5cb85

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Files/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
415415

416416
private void SaveSessionTabs() // Enumerates through all tabs and gets the Path property and saves it to AppSettings.LastSessionPages
417417
{
418-
AppSettings.LastSessionPages = MainPage.AppInstances.Select(x => x.Path ?? ResourceController.GetTranslation("NewTab")).ToArray();
418+
AppSettings.LastSessionPages = MainPage.AppInstances.DefaultIfEmpty().Select(x => x != null ? x.Path : ResourceController.GetTranslation("NewTab")).ToArray();
419419
}
420420

421421
// Occurs when an exception is not handled on the UI thread.

Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ private async void RemoveTab(TabItem tabItem)
343343
{
344344
if (Items.Count == 1)
345345
{
346+
MainPage.AppInstances.Remove(tabItem);
346347
await ApplicationView.GetForCurrentView().TryConsolidateAsync();
347348
}
348349
else if (Items.Count > 1)

Files/UserControls/MultitaskingControl/VerticalTabView.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ private void RemoveTab(TabItem tabItem)
333333
{
334334
if (Items.Count == 1)
335335
{
336+
MainPage.AppInstances.Remove(tabItem);
336337
App.CloseApp();
337338
}
338339
else if (Items.Count > 1)

Files/Views/MainPage.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
111111
{
112112
await AddNewTab(typeof(ModernShellPage), path);
113113
}
114+
App.AppSettings.LastSessionPages = new string[] { ResourceController.GetTranslation("NewTab") };
114115
}
115116
else
116117
{

0 commit comments

Comments
 (0)