Skip to content

Commit 5bbb94e

Browse files
fix: Adding a file when adding a new row in the data browser doesn't show filename (#2471)
1 parent e45d7bf commit 5bbb94e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/BrowserCell/BrowserCell.react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default class BrowserCell extends Component {
131131
} else if (this.props.type === 'Object' || this.props.type === 'Bytes') {
132132
this.copyableValue = content = JSON.stringify(this.props.value);
133133
} else if (this.props.type === 'File') {
134-
const fileName = this.props.value.url() ? getFileName(this.props.value) : 'Uploading\u2026';
134+
const fileName = this.props.value ? this.props.value.url() ? getFileName(this.props.value) : this.props.value.name() : 'Uploading\u2026';
135135
content = <Pill value={fileName} fileDownloadLink={this.props.value.url()} shrinkablePill />;
136136
this.copyableValue = fileName;
137137
} else if (this.props.type === 'ACL') {

src/dashboard/Data/Browser/EditRowDialog.react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ export default class EditRowDialog extends React.Component {
352352
break;
353353
case 'File':
354354
let file = selectedObject[name];
355-
let fileName = file && file.url() ? getFileName(file) : '';
355+
let fileName = file ? file.url() ? getFileName(file) : file.name() : '';
356356
inputComponent = (
357357
<div className={[styles.editRowDialogFileCell]}>
358358
{file && <Pill value={fileName} fileDownloadLink={file.url()} />}

0 commit comments

Comments
 (0)