diff --git a/src/devices/WindowsDevice.js b/src/devices/WindowsDevice.js new file mode 100644 index 000000000..ba1d8471e --- /dev/null +++ b/src/devices/WindowsDevice.js @@ -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 {DeviceLogListener} from './BaseDevice.js'; +import BaseDevice from './BaseDevice.js'; + +export default class WindowsDevice extends BaseDevice { + supportedPlugins = []; + icon = 'icons/oculus.png'; + os = 'windows'; + + constructor() { + super('', 'physical', 'desktop'); + } + + teardown() {} + + supportedColumns(): Array { + return []; + } + + addLogListener(_callback: DeviceLogListener) {} +} diff --git a/src/dispatcher/index.js b/src/dispatcher/index.js index 66f4152b2..dc00ff00b 100644 --- a/src/dispatcher/index.js +++ b/src/dispatcher/index.js @@ -7,6 +7,7 @@ import androidDevice from './androidDevice'; import iOSDevice from './iOSDevice'; +import windowsDevice from './windowsDevice'; import application from './application'; import tracking from './tracking'; import server from './server'; @@ -15,6 +16,11 @@ import type Logger from '../fb-stubs/Logger.js'; import type {Store} from '../reducers/index.js'; export default (store: Store, logger: Logger) => - [application, androidDevice, iOSDevice, tracking, server].forEach(fn => - fn(store, logger), - ); + [ + application, + androidDevice, + iOSDevice, + windowsDevice, + tracking, + server, + ].forEach(fn => fn(store, logger)); diff --git a/src/dispatcher/windowsDevice.js b/src/dispatcher/windowsDevice.js new file mode 100644 index 000000000..e22098e99 --- /dev/null +++ b/src/dispatcher/windowsDevice.js @@ -0,0 +1,21 @@ +/** + * 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-stubs/Logger.js'; + +import WindowsDevice from '../devices/WindowsDevice'; + +export default (store: Store, logger: Logger) => { + if (process.platform !== 'win32') { + return; + } + store.dispatch({ + type: 'REGISTER_DEVICE', + payload: new WindowsDevice(), + }); +};