Skip to content

Commit

Permalink
refresh folder from breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
kevodwyer committed Nov 21, 2024
1 parent 15b8d28 commit 7fd31e4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/views/Drive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1341,8 +1341,11 @@ module.exports = {
return Promise.resolve(null);
var path = this.getPath;
var that = this;
this.context.getByPath(path).thenApply(function (file) {
if (! file.get().isDirectory()) {
this.context.getByPath(path).thenApply(function (fileOpt) {
let file = fileOpt.get();
if (file != null) {
file.getLatest(that.context.network).thenApply(updated => {
if (! updated.isDirectory()) {
// go to parent if we tried to navigate to file
if (path.endsWith("/"))
path = path.substring(0, path.length-1)
Expand All @@ -1352,10 +1355,14 @@ module.exports = {
that.updateCurrentDirectory(selectedFilename, callback)
return;
}
that.currentDir = file.get();
that.updateFiles(selectedFilename, callback);
that.currentDir = updated;
that.updateFiles(selectedFilename, callback);
}).exceptionally(function (throwable) {
console.log("Unable to get updated folder. Error: " + throwable.getMessage());
});
}
}).exceptionally(function (throwable) {
console.log(throwable.getMessage());
console.log(throwable.getMessage());
});
},
Expand Down

0 comments on commit 7fd31e4

Please sign in to comment.