Customize "Open in Folder" message based on platform

This commit is contained in:
Alex Liebowitz 2017-01-09 06:31:42 -05:00
parent 78e9a02b70
commit 8d9e63ad53
2 changed files with 10 additions and 2 deletions

View file

@ -257,9 +257,10 @@ export let DownloadLink = React.createClass({
</span>
);
} else if (this.props.state == 'done') {
const openInFolderMessage = localStorage.getItem('platform') == 'Darwin' ? 'Open in Finder' : 'Open in Folder';
linkBlock = (
<DropDown button="alt" label="Open" onClick={this.handleClick} onCaretClick={this.openMenu}>
<MenuItem onClick={this.handleRevealClicked} label="Open in Folder" />
<MenuItem onClick={this.handleRevealClicked} label={openInFolderMessage} />
<MenuItem onClick={this.handleRemoveClicked} label="Remove..." />
</DropDown>
);

View file

@ -26,7 +26,14 @@ var init = function() {
}
});
} else {
ReactDOM.render(<App/>, canvas);
if (localStorage.getItem('platform') === null) {
lbry.getVersionInfo(({os_system}) => {
localStorage.setItem('platform', os_system);
ReactDOM.render(<App/>, canvas);
});
} else {
ReactDOM.render(<App/>, canvas);
}
}
}}/>,
canvas