Skip to content

Commit 3927340

Browse files
authored
fix: file upload dialog in data browser shows multiple times (#2276)
1 parent e16d576 commit 3927340

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class EditRowDialog extends React.Component {
2323
const { currentObject, openObjectPickers, expandedTextAreas } = this.initializeState(
2424
selectedObject
2525
);
26-
this.state = { currentObject, openObjectPickers, expandedTextAreas, showFileEditor: false };
26+
this.state = { currentObject, openObjectPickers, expandedTextAreas, showFileEditor: null };
2727

2828
this.updateCurrentObject = this.updateCurrentObject.bind(this);
2929
this.handleChange = this.handleChange.bind(this);
@@ -224,15 +224,15 @@ export default class EditRowDialog extends React.Component {
224224
this.setState({ expandedTextAreas });
225225
}
226226

227-
openFileEditor() {
227+
openFileEditor(column) {
228228
this.setState({
229-
showFileEditor: true
229+
showFileEditor: column
230230
});
231231
}
232232

233233
hideFileEditor() {
234234
this.setState({
235-
showFileEditor: false
235+
showFileEditor: null
236236
});
237237
}
238238

@@ -358,9 +358,9 @@ export default class EditRowDialog extends React.Component {
358358
<div style={{ cursor: 'pointer' }}>
359359
<Pill
360360
value={file ? 'Change file' : 'Select file'}
361-
onClick={() => this.openFileEditor()}
361+
onClick={() => this.openFileEditor(name)}
362362
/>
363-
{this.state.showFileEditor && (
363+
{this.state.showFileEditor === name && (
364364
<FileEditor
365365
value={file}
366366
onCancel={this.hideFileEditor}

0 commit comments

Comments
 (0)