Use in-browser platform check in DownloadLink

This commit is contained in:
Alex Liebowitz 2017-01-10 01:10:27 -05:00
parent 8d9e63ad53
commit 6ea5e41368
2 changed files with 2 additions and 9 deletions

View file

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

View file

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