Skip to content

Commit 62714c4

Browse files
authored
Fixed an issue where items wouldn't load in Box drive (#8808)
1 parent f40c8fc commit 62714c4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Files.Uwp/ViewModels/ItemViewModel.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,7 @@ private async Task RapidAddItemsToCollection(string path, LibraryItem library =
12971297
WatchForStorageFolderChanges(currentStorageFolder?.Folder);
12981298
break;
12991299

1300+
case 2: // Do no watch for changes in Box Drive folder to avoid constant refresh (#7428)
13001301
case -1: // Enumeration failed
13011302
default:
13021303
break;
@@ -1488,8 +1489,9 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
14881489
public async Task<int> EnumerateItemsFromStandardFolderAsync(string path, Type sourcePageType, CancellationToken cancellationToken, LibraryItem library = null)
14891490
{
14901491
// Flag to use FindFirstFileExFromApp or StorageFolder enumeration
1491-
bool enumFromStorageFolder =
1492-
path == App.CloudDrivesManager.Drives.FirstOrDefault(x => x.Text == "Box")?.Path?.TrimEnd('\\'); // Use storage folder for Box Drive (#4629)
1492+
var isBoxFolder = App.CloudDrivesManager.Drives.FirstOrDefault(x => x.Text == "Box")?.Path?.TrimEnd('\\') is string boxFolder ?
1493+
path.StartsWith(boxFolder) : false;
1494+
bool enumFromStorageFolder = isBoxFolder; // Use storage folder for Box Drive (#4629)
14931495

14941496
BaseStorageFolder rootFolder = null;
14951497

@@ -1580,7 +1582,7 @@ await DialogDisplayHelper.ShowDialogAsync(
15801582
}
15811583
CurrentFolder = currentFolder;
15821584
await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, currentStorageFolder, sourcePageType, cancellationToken);
1583-
return 1;
1585+
return isBoxFolder ? 2 : 1; // Workaround for #7428
15841586
}
15851587
else
15861588
{

0 commit comments

Comments
 (0)