Commit bd10c079 authored by kenobi's avatar kenobi Committed by Commit bot

Files.app: Fix notifications that are popping up after a media import has completed.

The ImportTask appears to be firing a final progress event after the success event has been fired; this is causing the UI to pop up a zombie import-related progress notification that never goes away.  Fix by preventing the task from emitting further notifications once it's successfully completed.

BUG=420680

Review URL: https://codereview.chromium.org/839473006

Cr-Commit-Position: refs/heads/master@{#311498}
parent fad5e6ac
...@@ -113,9 +113,13 @@ importer.MediaImportHandler.prototype.onTaskProgress_ = ...@@ -113,9 +113,13 @@ importer.MediaImportHandler.prototype.onTaskProgress_ =
strf('CLOUD_IMPORT_ITEMS_REMAINING', task.remainingFilesCount); strf('CLOUD_IMPORT_ITEMS_REMAINING', task.remainingFilesCount);
break; break;
case UpdateType.SUCCESS: case UpdateType.SUCCESS:
item.message = '';
item.progressValue = item.progressMax;
item.state = ProgressItemState.COMPLETED; item.state = ProgressItemState.COMPLETED;
break; break;
case UpdateType.ERROR: case UpdateType.ERROR:
item.message = '';
item.progressValue = item.progressMax;
item.state = ProgressItemState.ERROR; item.state = ProgressItemState.ERROR;
break; break;
} }
...@@ -281,9 +285,9 @@ importer.MediaImportHandler.ImportTask.prototype.importOne_ = ...@@ -281,9 +285,9 @@ importer.MediaImportHandler.ImportTask.prototype.importOne_ =
/** @this {importer.MediaImportHandler.ImportTask} */ /** @this {importer.MediaImportHandler.ImportTask} */
var onComplete = function() { var onComplete = function() {
completionCallback();
this.markAsCopied_(entry, destination); this.markAsCopied_(entry, destination);
this.notify(importer.TaskQueue.UpdateType.PROGRESS); this.notify(importer.TaskQueue.UpdateType.PROGRESS);
completionCallback();
}; };
fileOperationUtil.copyTo( fileOperationUtil.copyTo(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment