Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed Feb 27, 2024
1 parent 63364ea commit e3ec955
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public MultitaskingContext()
private void AppInstances_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
UpdateTabCount();
AppLifecycleHelper.SaveSessionTabs();
}
private void AppModel_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Files.App/Helpers/Navigation/NavigationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static async Task AddNewTabByPathAsync(Type type, string? path, int atInd
MainPageViewModel.AppInstances.Insert(index, tabItem);

App.AppModel.TabStripSelectedIndex = index;

AppLifecycleHelper.SaveSessionTabs();
}

public static async Task AddNewTabByParamAsync(Type type, object tabViewItemArgs, int atIndex = -1)
Expand All @@ -86,6 +88,8 @@ public static async Task AddNewTabByParamAsync(Type type, object tabViewItemArgs
var index = atIndex == -1 ? MainPageViewModel.AppInstances.Count : atIndex;
MainPageViewModel.AppInstances.Insert(index, tabItem);
App.AppModel.TabStripSelectedIndex = index;

AppLifecycleHelper.SaveSessionTabs();
}

private static async Task UpdateTabInfoAsync(TabBarItem tabItem, object navigationArg)
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/UserControls/TabBar/BaseTabBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public void CloseTab(TabBarItem tabItem)
tabItem.NavigationParameter,
});


AppLifecycleHelper.SaveSessionTabs();

if (Items.Count == 0)
MainWindow.Instance.Close();
}
Expand Down

0 comments on commit e3ec955

Please sign in to comment.