Skip to content

Commit

Permalink
fix: Adding a file when adding a new row in the data browser doesn't …
Browse files Browse the repository at this point in the history
…show filename (#2471)
  • Loading branch information
AshishBarvaliya authored Jun 30, 2023
1 parent e45d7bf commit 5bbb94e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class BrowserCell extends Component {
} else if (this.props.type === 'Object' || this.props.type === 'Bytes') {
this.copyableValue = content = JSON.stringify(this.props.value);
} else if (this.props.type === 'File') {
const fileName = this.props.value.url() ? getFileName(this.props.value) : 'Uploading\u2026';
const fileName = this.props.value ? this.props.value.url() ? getFileName(this.props.value) : this.props.value.name() : 'Uploading\u2026';
content = <Pill value={fileName} fileDownloadLink={this.props.value.url()} shrinkablePill />;
this.copyableValue = fileName;
} else if (this.props.type === 'ACL') {
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/EditRowDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export default class EditRowDialog extends React.Component {
break;
case 'File':
let file = selectedObject[name];
let fileName = file && file.url() ? getFileName(file) : '';
let fileName = file ? file.url() ? getFileName(file) : file.name() : '';
inputComponent = (
<div className={[styles.editRowDialogFileCell]}>
{file && <Pill value={fileName} fileDownloadLink={file.url()} />}
Expand Down

0 comments on commit 5bbb94e

Please sign in to comment.