decrease setProgress updates (#833)
This commit is contained in:
committed by
GitHub
parent
d2da6881d6
commit
f1cf37200e
@@ -24,7 +24,11 @@ function getDefaultState () {
|
|||||||
*/
|
*/
|
||||||
client: null, /* the WebTorrent client */
|
client: null, /* the WebTorrent client */
|
||||||
server: null, /* local WebTorrent-to-HTTP server */
|
server: null, /* local WebTorrent-to-HTTP server */
|
||||||
prev: {}, /* used for state diffing in updateElectron() */
|
prev: { /* used for state diffing in updateElectron() */
|
||||||
|
title: null,
|
||||||
|
progress: -1,
|
||||||
|
badge: null
|
||||||
|
},
|
||||||
location: new LocationHistory(),
|
location: new LocationHistory(),
|
||||||
window: {
|
window: {
|
||||||
bounds: null, /* {x, y, width, height } */
|
bounds: null, /* {x, y, width, height } */
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ function updateElectron () {
|
|||||||
state.prev.title = state.window.title
|
state.prev.title = state.window.title
|
||||||
ipcRenderer.send('setTitle', state.window.title)
|
ipcRenderer.send('setTitle', state.window.title)
|
||||||
}
|
}
|
||||||
if (state.dock.progress !== state.prev.progress) {
|
if (state.dock.progress.toFixed(2) !== state.prev.progress.toFixed(2)) {
|
||||||
state.prev.progress = state.dock.progress
|
state.prev.progress = state.dock.progress
|
||||||
ipcRenderer.send('setProgress', state.dock.progress)
|
ipcRenderer.send('setProgress', state.dock.progress)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user