Loëck Vézien
7 years ago
4 changed files with 57 additions and 70 deletions
@ -0,0 +1,19 @@ |
|||
// @flow
|
|||
|
|||
import React from 'react' |
|||
import { Route } from 'react-router' |
|||
|
|||
import Box from 'components/base/Box' |
|||
import SideBar from 'components/SideBar' |
|||
import TopBar from 'components/TopBar' |
|||
import Home from 'components/Home' |
|||
|
|||
export default () => ( |
|||
<Box grow horizontal> |
|||
<SideBar /> |
|||
<Box grow bg="cream"> |
|||
<TopBar /> |
|||
<Route path="/" component={Home} /> |
|||
</Box> |
|||
</Box> |
|||
) |
@ -0,0 +1,17 @@ |
|||
// @flow
|
|||
|
|||
import { ipcRenderer } from 'electron' |
|||
|
|||
import { devicesUpdate, deviceAdd, deviceRemove } from 'actions/devices' |
|||
|
|||
export default (store: Object) => { |
|||
ipcRenderer.on('updateDevices', (e, devices) => store.dispatch(devicesUpdate(devices))) |
|||
ipcRenderer.on('addDevice', (e, device) => store.dispatch(deviceAdd(device))) |
|||
ipcRenderer.on('removeDevice', (e, device) => store.dispatch(deviceRemove(device))) |
|||
|
|||
// First time, we get all devices
|
|||
ipcRenderer.send('getDevices') |
|||
|
|||
// Start detection when we plug/unplug devices
|
|||
ipcRenderer.send('listenDevices') |
|||
} |
Loading…
Reference in new issue