Skip to content

Commit 4e66a53

Browse files
authored
Fixed an issue where navigating away from the home page sometimes wouldn't work (#1926)
1 parent f8c844b commit 4e66a53

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Files/UserControls/YourHome.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public YourHome()
1414
InitializeComponent();
1515
}
1616

17-
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
17+
protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
1818
{
1919
base.OnNavigatedTo(eventArgs);
2020
App.CurrentInstance.InstanceViewModel.IsPageTypeNotHome = false;
@@ -29,6 +29,9 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
2929
App.CurrentInstance.NavigationToolbar.CanGoForward = App.CurrentInstance.ContentFrame.CanGoForward;
3030
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = false;
3131

32+
// Set path of working directory empty
33+
await App.CurrentInstance.FilesystemViewModel.SetWorkingDirectory("Home");
34+
3235
// Clear the path UI and replace with Favorites
3336
App.CurrentInstance.NavigationToolbar.PathComponents.Clear();
3437
string componentLabel = parameters;

Files/View Models/ItemViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ public async Task SetWorkingDirectory(string value)
116116
_customPath = null;
117117
}
118118

119+
if (value == "Home")
120+
{
121+
_currentStorageFolder = null;
122+
}
123+
119124
NotifyPropertyChanged(nameof(WorkingDirectory));
120125
}
121126

0 commit comments

Comments
 (0)