Skip to content

Commit

Permalink
Merge pull request #38 from copios-jp/master
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
copios authored Jan 25, 2019
2 parents 7ad45fa + 1aafe85 commit 926ec60
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 0 additions & 3 deletions app/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ app.on('ready', async () => {
})

mainWindow.webContents.on('will-navigate', () => {
console.log('will navigate')
scanner.deactivate()
})

Expand All @@ -75,7 +74,6 @@ app.on('ready', async () => {
})

app.on('before-quit', () => {
console.log('before quit')
PowerSaveBlocker.deactivate()
})

Expand Down Expand Up @@ -111,6 +109,5 @@ ipcMain.on('print', (event, fileName) => {
})

ipcMain.on('deactivate', () => {
console.log('deactivate')
scanner.deactivate()
})
20 changes: 15 additions & 5 deletions app/main/services/bridge/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
const emit = (...args) => {
const webContents = args.shift()

if (webContents.isDestroyed()) {
return
}

webContents.send(...args)
}

export const onTransmitterData = (webContents) => {
return (transmitter, transmitters) => {
webContents.send('transmitter-data', transmitter, transmitters)
emit(webContents, 'transmitter-data', transmitter, transmitters)
}
}

export const onTransmitterAdded = (webContents) => {
return (transmitter, transmitters) => {
webContents.send('transmitter-added', transmitter, transmitters)
emit(webContents, 'transmitter-added', transmitter, transmitters)
}
}

export const onTransmitterRemoved = (webContents) => {
return (transmitter, transmitters) => {
webContents.send('transmitter-removed', transmitter, transmitters)
emit(webContents, 'transmitter-removed', transmitter, transmitters)
}
}

export const onReceiverAdded = (webContents) => {
return (receiver, receivers) => {
webContents.send('receiver-added', receiver, receivers)
emit(webContents, 'receiver-added', receiver, receivers)
receiver.on('transmitter-added', onTransmitterAdded(webContents))
receiver.on('transmitter-removed', onTransmitterRemoved(webContents))
receiver.on('transmitter-data', onTransmitterData(webContents))
Expand All @@ -27,7 +37,7 @@ export const onReceiverAdded = (webContents) => {

export const onReceiverRemoved = (webContents) => {
return (receiver, receivers) => {
webContents.send('receiver-removed', receiver, receivers)
emit(webContents, 'receiver-removed', receiver, receivers)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TrainingScoreChart extends Component {
<XYPlot width={200} height={200} className={classes.trainingScoreChart} colorType="literal">
{segments({ opacity: 0.1 })}
{segments({ limit: score })}
{label({ color: colors[zone], label: score.toString() })}
{label({ color: colors[zone], label: score.toFixed(2) })}
</XYPlot>
)
}
Expand Down
2 changes: 2 additions & 0 deletions app/renderer/styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default (theme) => ({
},

cardName: {
whiteSpace: 'nowrap',
overflow: 'hidden',
flexGrow: 1,
marginLeft: theme.spacing.unit * 3,
},
Expand Down

0 comments on commit 926ec60

Please sign in to comment.