Skip to content

Commit 88b4eb9

Browse files
authored
Fix: No items selected after deletion (#11908)
1 parent e888eb1 commit 88b4eb9

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/Files.App/ViewModels/ItemViewModel.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,6 @@ private async Task ProcessOperationQueue(CancellationToken cancellationToken, bo
19441944

19451945
var anyEdits = false;
19461946
ListedItem? lastItemAdded = null;
1947-
ListedItem? nextOfLastItemRemoved = null;
19481947
var rand = Guid.NewGuid();
19491948

19501949
// Call when any edits have occurred
@@ -1959,12 +1958,6 @@ async Task HandleChangesOccurredAsync()
19591958
lastItemAdded = null;
19601959
}
19611960

1962-
if (nextOfLastItemRemoved is not null)
1963-
{
1964-
await RequestSelectionAsync(new List<ListedItem>() { nextOfLastItemRemoved });
1965-
nextOfLastItemRemoved = null;
1966-
}
1967-
19681961
anyEdits = false;
19691962
}
19701963

@@ -1998,10 +1991,6 @@ async Task HandleChangesOccurredAsync()
19981991
break;
19991992

20001993
case FILE_ACTION_REMOVED:
2001-
// Get the item that immediately follows matching item to be removed
2002-
// If the matching item is the last item, try to get the previous item; otherwise, null
2003-
var itemRemovedIndex = filesAndFolders.FindIndex(x => x.ItemPath.Equals(operation.FileName));
2004-
nextOfLastItemRemoved = filesAndFolders.ElementAtOrDefault(itemRemovedIndex + 1 < filesAndFolders.Count ? itemRemovedIndex + 1 : itemRemovedIndex - 1);
20051994
var itemRemoved = await RemoveFileOrFolderAsync(operation.FileName);
20061995
if (itemRemoved is not null)
20071996
anyEdits = true;

0 commit comments

Comments
 (0)