Skip to content

Commit 308ad46

Browse files
author
Vikas Agarwal
committed
Fixing Duplicate metadata button error
1 parent f06803d commit 308ad46

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/routes/metadata/components/MetaDataPanel.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,11 @@ class MetaDataPanel extends React.Component {
398398
} else {
399399
if (newValues.hasOwnProperty('id')) {
400400
newValues.id = null
401-
} else {
402-
newValues.key = null
403401
}
402+
if (newValues.hasOwnProperty('aliases')) {
403+
newValues.aliases = null
404+
}
405+
newValues.key = null
404406
}
405407

406408
this.setState({
@@ -540,8 +542,8 @@ class MetaDataPanel extends React.Component {
540542
templates={[]}
541543
onProjectChange={this.props.firePreviewProjectDirty}
542544
projectTemplates={[{
543-
id: 'new',
544-
...metadata
545+
...metadata,
546+
id: metadata.id || 'new'
545547
}]}
546548
productTemplates={templates.productTemplates}
547549
productCategories={templates.productCategories}

0 commit comments

Comments
 (0)