Skip to content

Commit

Permalink
File Picker - selected file bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kevodwyer committed Nov 19, 2024
1 parent f432b68 commit c8a5ff9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/sandbox/AppSandbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ module.exports = {
confirm_consumer_cancel_func: () => {},
confirm_consumer_func: () => {},
displayToBookmark: true,
pickerSelectedFile: "",
}
},
computed: {
Expand Down Expand Up @@ -887,6 +888,7 @@ module.exports = {
&& !(this.appPath.length > 0 && !this.isAppPathAFolder && path.startsWith(that.getPath))
&& !path.startsWith(that.apiRequest + '/data')
&& !(this.isSelectedFolder(path))
&& !(path == this.pickerSelectedFile)
? '/assets' : '';
if (this.browserMode) {
that.handleBrowserRequest(headerFunc, path, params, isFromRedirect, isNavigate);
Expand Down Expand Up @@ -1031,6 +1033,7 @@ module.exports = {
}
that.showFilePicker = false;
let encoder = new TextEncoder();
that.pickerSelectedFile = selectedFile;
let data = encoder.encode(JSON.stringify([selectedFile]));
that.buildResponse(headerFunc(), data, that.UPDATE_SUCCESS);
}.bind(this);
Expand Down Expand Up @@ -3506,6 +3509,8 @@ module.exports = {
return this.workspaceName + filePath;
} else if ( (this.appPath.length > 0 && filePath.startsWith(this.getPath)) || this.isSelectedFolder(filePath)) {
return filePath;
} else if (this.appPath.length > 0 && filePath === this.pickerSelectedFile) {
return filePath;
} else if (this.currentProps != null) { //running in-place
let filePathWithoutSlash = filePath.startsWith('/') ? filePath.substring(1) : filePath;
return this.getPath + filePathWithoutSlash;
Expand Down

0 comments on commit c8a5ff9

Please sign in to comment.