Add MacDevice

Summary:
Add a desktop device on MacOS similar to WindowsDevice (see D8861986).
This makes it possible to view Oculus Service Log files on MacOS too.

Reviewed By: danielbuechele

Differential Revision: D15147501

fbshipit-source-id: 8a076964e6111bf3786818b7cbd8bb7f81c1498d
This commit is contained in:
Zoltán Gilián
2019-04-30 07:14:54 -07:00
committed by Facebook Github Bot
parent 8ba4feba66
commit d9bb1c5cf1
4 changed files with 33 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import type {Store} from '../reducers/index.js';
import type {Logger} from '../fb-interfaces/Logger.js';
import MacDevice from '../devices/MacDevice';
import WindowsDevice from '../devices/WindowsDevice';
export default (store: Store, logger: Logger) => {
var device;
if (process.platform === 'darwin') {
device = new MacDevice();
} else if (process.platform === 'win32') {
device = new WindowsDevice();
} else {
return;
}
store.dispatch({
type: 'REGISTER_DEVICE',
payload: device,
});
};