Skip to content

Commit 47e133a

Browse files
committed
Prevent Stale Items During Rapid Up/Back/Forward Navigation
1 parent f044481 commit 47e133a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ public void CancelLoadAndClearFiles()
244244
{
245245
_fileQueryResult.ContentsChanged -= FileContentsChanged;
246246
}
247+
App.selectedTabInstance.BackButton.IsEnabled = true;
248+
App.selectedTabInstance.ForwardButton.IsEnabled = true;
249+
App.selectedTabInstance.UpButton.IsEnabled = true;
250+
247251
}
248252

249253
public static T GetCurrentSelectedTabInstance<T>()

Files UWP/ProHome.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,8 +1013,9 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch
10131013

10141014
public static void Back_Click(object sender, RoutedEventArgs e)
10151015
{
1016+
App.selectedTabInstance.BackButton.IsEnabled = false;
10161017
Frame instanceContentFrame = App.selectedTabInstance.accessibleContentFrame;
1017-
1018+
App.selectedTabInstance.instanceViewModel.CancelLoadAndClearFiles();
10181019
if ((App.selectedTabInstance.accessibleContentFrame.Content as GenericFileBrowser) != null)
10191020
{
10201021
var instanceContent = (instanceContentFrame.Content as GenericFileBrowser);
@@ -1249,6 +1250,8 @@ public static void Back_Click(object sender, RoutedEventArgs e)
12491250

12501251
public static void Forward_Click(object sender, RoutedEventArgs e)
12511252
{
1253+
App.selectedTabInstance.ForwardButton.IsEnabled = false;
1254+
App.selectedTabInstance.instanceViewModel.CancelLoadAndClearFiles();
12521255
Frame instanceContentFrame = App.selectedTabInstance.accessibleContentFrame;
12531256
if ((App.selectedTabInstance.accessibleContentFrame.Content as GenericFileBrowser) != null)
12541257
{
@@ -1486,8 +1489,9 @@ public static void Forward_Click(object sender, RoutedEventArgs e)
14861489

14871490
public static void Up_Click(object sender, RoutedEventArgs e)
14881491
{
1492+
App.selectedTabInstance.UpButton.IsEnabled = false;
14891493
Frame instanceContentFrame = App.selectedTabInstance.accessibleContentFrame;
1490-
1494+
App.selectedTabInstance.instanceViewModel.CancelLoadAndClearFiles();
14911495
if ((instanceContentFrame.Content as GenericFileBrowser) != null)
14921496
{
14931497
var instance = App.selectedTabInstance.instanceViewModel;

0 commit comments

Comments
 (0)