Skip to content

Commit 5051ba2

Browse files
author
Christopher Willis-Ford
committed
Code review: remove dead code, clarify arg name
1 parent 3e33c10 commit 5051ba2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/components/menu-bar/menu-bar.jsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class MenuBar extends React.Component {
150150
'handleClickSaveAsCopy',
151151
'handleClickSeeCommunity',
152152
'handleClickShare',
153-
'handleCloseFileMenuAndThen',
154153
'handleKeyPress',
155154
'handleLanguageMouseUp',
156155
'handleRestoreOption',
@@ -221,23 +220,17 @@ class MenuBar extends React.Component {
221220
this.props.onRequestCloseEdit();
222221
};
223222
}
224-
handleCloseFileMenuAndThen (fn) {
225-
return () => {
226-
this.props.onRequestCloseFile();
227-
fn();
228-
};
229-
}
230223
handleKeyPress (event) {
231224
const modifier = bowser.mac ? event.metaKey : event.ctrlKey;
232225
if (modifier && event.key === 's') {
233226
this.props.onClickSave();
234227
event.preventDefault();
235228
}
236229
}
237-
handleSaveToComputer (downloadProject) {
230+
handleSaveToComputer (downloadProjectCallback) {
238231
return () => {
239232
this.props.onRequestCloseFile();
240-
downloadProject();
233+
downloadProjectCallback();
241234
if (this.props.onProjectTelemetryEvent) {
242235
const metadata = collectMetadata(this.props.vm, this.props.projectTitle, this.props.locale);
243236
this.props.onProjectTelemetryEvent('projectDidSave', metadata);
@@ -417,10 +410,10 @@ class MenuBar extends React.Component {
417410
</MenuItem>
418411
)}
419412
</SBFileUploader>
420-
<SB3Downloader>{(className, downloadProject) => (
413+
<SB3Downloader>{(className, downloadProjectCallback) => (
421414
<MenuItem
422415
className={className}
423-
onClick={this.handleSaveToComputer(downloadProject)}
416+
onClick={this.handleSaveToComputer(downloadProjectCallback)}
424417
>
425418
<FormattedMessage
426419
defaultMessage="Save to your computer"

0 commit comments

Comments
 (0)