Skip to content

Commit 2ade23f

Browse files
committed
Prevent jumbled items by blocking rapid Refresh clicks
1 parent f8f545f commit 2ade23f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ public async void DisplayConsentDialog()
207207

208208
public async void AddItemsToCollectionAsync(string path, Page currentPage)
209209
{
210+
ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().RefreshButton.IsEnabled = false;
211+
210212
Frame rootFrame = Window.Current.Content as Frame;
211213
var instanceTabsView = rootFrame.Content as InstanceTabsView;
212214
instanceTabsView.SetSelectedTabHeader(new DirectoryInfo(path).Name);
@@ -367,7 +369,7 @@ public async void AddItemsToCollectionAsync(string path, Page currentPage)
367369
}
368370
stopwatch.Stop();
369371
Debug.WriteLine("Loading of items in " + Universal.path + " completed in " + stopwatch.ElapsedMilliseconds + " milliseconds.\n");
370-
372+
ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().RefreshButton.IsEnabled = true;
371373
}
372374
catch (UnauthorizedAccessException e)
373375
{

Files UWP/ProHome.xaml.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
using System.Diagnostics;
99
using System.IO;
1010
using System.Linq;
11-
using Windows.Foundation.Metadata;
1211
using Windows.Storage;
1312
using Windows.System;
1413
using Windows.UI.Core;
1514
using Windows.UI.Popups;
16-
using Windows.UI.WindowManagement;
1715
using Windows.UI.Xaml;
1816
using Windows.UI.Xaml.Controls;
19-
using Windows.UI.Xaml.Hosting;
2017
using Windows.UI.Xaml.Input;
2118
using Windows.UI.Xaml.Media;
2219
using Windows.UI.Xaml.Media.Animation;
@@ -114,7 +111,7 @@ public ProHome()
114111
public async void PopulatePinnedSidebarItems()
115112
{
116113
StorageFile ListFile;
117-
StorageFolder cacheFolder = Windows.Storage.ApplicationData.Current.LocalCacheFolder;
114+
StorageFolder cacheFolder = ApplicationData.Current.LocalCacheFolder;
118115
try
119116
{
120117
ListFile = await cacheFolder.GetFileAsync("PinnedItems.txt");

0 commit comments

Comments
 (0)