Skip to content

Commit 90e286a

Browse files
authored
Merge pull request #2277 from processing/2276-duplicate-function-in-menu-does-not-work
add handler for the duplicate menu item
2 parents 149eb6e + 2972040 commit 90e286a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/components/Nav.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Nav extends React.PureComponent {
3030
super(props);
3131
this.handleSave = this.handleSave.bind(this);
3232
this.handleNew = this.handleNew.bind(this);
33+
this.handleDuplicate = this.handleDuplicate.bind(this);
3334
this.handleShare = this.handleShare.bind(this);
3435
this.handleDownload = this.handleDownload.bind(this);
3536
this.handleLangSelection = this.handleLangSelection.bind(this);
@@ -56,6 +57,10 @@ class Nav extends React.PureComponent {
5657
}
5758
}
5859

60+
handleDuplicate() {
61+
this.props.cloneProject();
62+
}
63+
5964
handleLangSelection(event) {
6065
this.props.setLanguage(event.target.value);
6166
this.props.showToast(1500);
@@ -132,7 +137,7 @@ class Nav extends React.PureComponent {
132137
</NavMenuItem>
133138
<NavMenuItem
134139
hideIf={!this.props.project.id || !this.props.user.authenticated}
135-
onClick={this.props.cloneProject}
140+
onClick={this.handleDuplicate}
136141
>
137142
{this.props.t('Nav.File.Duplicate')}
138143
</NavMenuItem>

0 commit comments

Comments
 (0)