dock: show client progress

This commit is contained in:
Feross Aboukhadijeh
2016-03-03 13:52:32 -08:00
parent f0bd05917b
commit aed424d0bc
2 changed files with 25 additions and 6 deletions

View File

@@ -74,6 +74,19 @@ function update () {
var patches = diff(currentVDom, newVDom)
rootElement = patch(rootElement, patches)
currentVDom = newVDom
updateDockIcon()
}
function updateDockIcon () {
if (state.view.client) {
var progress = state.view.client.progress
// Hide progress bar when client has no torrents, or progress is 100%
if (state.view.client.torrents.length === 0 || progress === 1) {
progress = -1
}
electron.ipcRenderer.send('setProgress', progress)
}
}
setInterval(function () {