| Index: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| index 35ecd10b61ec694a1f9da2a66a4438a4b6fd9a87..544b6600b80d060d465a5c914d0e84fe77bbb354 100644
|
| --- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| +++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
|
| @@ -1261,20 +1261,30 @@ FileTransferController.prototype.simulateCommand_ = function(command, handler) {
|
| */
|
| FileTransferController.prototype.onFileSelectionChanged_ = function() {
|
| this.preloadedThumbnailImagePromise_ = null;
|
| - this.selectedAsyncData_ = {};
|
| };
|
|
|
| /**
|
| * @private
|
| */
|
| FileTransferController.prototype.onFileSelectionChangedThrottled_ = function() {
|
| + // Remove file objects that are no longer in the selection.
|
| + var asyncData = {};
|
| var entries = this.selectionHandler_.selection.entries;
|
| - var asyncData = this.selectedAsyncData_;
|
| + for (var i = 0; i < entries.length; i++) {
|
| + var entryUrl = entries[i].toURL();
|
| + if (entryUrl in this.selectedAsyncData_) {
|
| + asyncData[entryUrl] = this.selectedAsyncData_[entryUrl];
|
| + }
|
| + }
|
| + this.selectedAsyncData_ = asyncData;
|
| +
|
| var fileEntries = [];
|
| for (var i = 0; i < entries.length; i++) {
|
| if (entries[i].isFile)
|
| fileEntries.push(entries[i]);
|
| - asyncData[entries[i].toURL()] = {externalFileUrl: '', file: null};
|
| + if (!(entries[i].toURL() in asyncData)) {
|
| + asyncData[entries[i].toURL()] = {externalFileUrl: '', file: null};
|
| + }
|
| }
|
| var containsDirectory = this.selectionHandler_.selection.directoryCount > 0;
|
|
|
| @@ -1285,9 +1295,11 @@ FileTransferController.prototype.onFileSelectionChangedThrottled_ = function() {
|
| if (!containsDirectory) {
|
| for (var i = 0; i < fileEntries.length; i++) {
|
| (function(fileEntry) {
|
| - fileEntry.file(function(file) {
|
| - asyncData[fileEntry.toURL()].file = file;
|
| - });
|
| + if (!(asyncData[fileEntry.toURL()].file)) {
|
| + fileEntry.file(function(file) {
|
| + asyncData[fileEntry.toURL()].file = file;
|
| + });
|
| + }
|
| })(fileEntries[i]);
|
| }
|
| }
|
|
|