Skip to content

Commit

Permalink
Fix: Fixed crash that would occur when starting Files from WSL direct…
Browse files Browse the repository at this point in the history
…ories (#16617)
  • Loading branch information
gave92 authored Dec 19, 2024
1 parent 6089e6f commit 0093c5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Files.App/Helpers/Application/AppLifecycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static void ConfigureSentry()
public static IHost ConfigureHost()
{
var builder = Host.CreateDefaultBuilder()
.UseContentRoot(Package.Current.InstalledLocation.Path)
.UseEnvironment(AppLifecycleHelper.AppEnvironment.ToString())
.ConfigureLogging(builder => builder
.ClearProviders()
Expand Down
6 changes: 3 additions & 3 deletions src/Files.App/ViewModels/MainPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ public async Task OnNavigatedToAsync(NavigationEventArgs e)
// add last session tabs to closed tabs stack if those tabs are not about to be opened
if (!UserSettingsService.AppSettingsService.RestoreTabsOnStartup && !UserSettingsService.GeneralSettingsService.ContinueLastSessionOnStartUp && UserSettingsService.GeneralSettingsService.LastSessionTabList != null)
{
var items = new TabBarItemParameter[UserSettingsService.GeneralSettingsService.LastSessionTabList.Count];
for (int i = 0; i < items.Length; i++)
items[i] = TabBarItemParameter.Deserialize(UserSettingsService.GeneralSettingsService.LastSessionTabList[i]);
var items = UserSettingsService.GeneralSettingsService.LastSessionTabList
.Where(tab => !string.IsNullOrEmpty(tab))
.Select(tab => TabBarItemParameter.Deserialize(tab)).ToArray();

BaseTabBar.PushRecentTab(items);
}
Expand Down

0 comments on commit 0093c5e

Please sign in to comment.