Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_model.js

Issue 639273002: Fixed a bug that the list still shows deleted directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed to handle volumeInfo null case. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_watcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/directory_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index eb7828e1e9bef59734259dcb80c6e70c6ee901c9..ec44c1e6e7f6bf02507e3ca488cc4e1b600852f8 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -173,6 +173,18 @@ DirectoryModel.prototype.updateSelectionAndPublishEvent_ =
DirectoryModel.prototype.onWatcherDirectoryChanged_ = function(event) {
var directoryEntry = this.getCurrentDirEntry();
+ // If the change is deletion of currentDir, move up to its parent directory.
+ directoryEntry.getDirectory(directoryEntry.fullPath, {create: false},
+ null,
+ function() {
+ var volumeInfo = this.volumeManager_.getVolumeInfo(directoryEntry);
+ if (volumeInfo) {
+ volumeInfo.resolveDisplayRoot().then(function(displayRoot) {
+ this.changeDirectoryEntry(displayRoot);
+ }.bind(this));
+ }
+ }.bind(this));
+
if (event.changedFiles) {
var addedOrUpdatedFileUrls = [];
var deletedFileUrls = [];
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_watcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698