mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
Detect mac vs windows
This commit is contained in:
parent
287bc8405a
commit
0c5de6cea1
1 changed files with 8 additions and 1 deletions
|
@ -10,8 +10,15 @@ class ExtensionLanding extends React.Component {
|
|||
'onSetOS'
|
||||
]);
|
||||
|
||||
let detectedOS = OS_ENUM.WINDOWS;
|
||||
if (window.navigator && window.navigator.platform) {
|
||||
if (window.navigator.platform === 'MacIntel') {
|
||||
detectedOS = OS_ENUM.MACOS;
|
||||
}
|
||||
}
|
||||
|
||||
this.state = {
|
||||
OS: OS_ENUM.WINDOWS
|
||||
OS: detectedOS
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue