Skip to content

Commit

Permalink
[FilesTrash] Remove empty current directory check for empty-trash cmd
Browse files Browse the repository at this point in the history
The check for whether the current directory is empty before emptying
Trash was incorrect as the state of the current directory should
make no difference to the emptying action. Remove this check.

The "empty trash?" dialog will continue to be shown, even if there are
no files in Trash.

Bug: b/284362857
Change-Id: Ia3ba2589450af506f7616e44d3731bb375d488a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4569974
Commit-Queue: Ben Reich <benreich@chromium.org>
Reviewed-by: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1150172}
  • Loading branch information
Cassy Chun-Crogan authored and Chromium LUCI CQ committed May 29, 2023
1 parent 6c33adb commit 68ff8f7
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,6 @@ CommandHandler
*/
CommandHandler.COMMANDS_['empty-trash'] = new (class extends FilesCommand {
execute(event, fileManager) {
const numEntries = fileManager.directoryModel.getFileList().length;
if (numEntries === 0) {
return;
}

fileManager.ui.emptyTrashConfirmDialog.showWithTitle(
str('CONFIRM_EMPTY_TRASH_TITLE'), str('CONFIRM_EMPTY_TRASH_DESC'),
() => {
Expand Down

0 comments on commit 68ff8f7

Please sign in to comment.