do not show prog bar when not downloading

This commit is contained in:
SpikeHD
2022-05-29 22:04:17 -07:00
parent 6f5ed86f03
commit 92f51cc306

View File

@@ -83,6 +83,15 @@ class App extends React.Component<IProps, IState> {
await setConfigOption('cert_generated', true) await setConfigOption('cert_generated', true)
} }
// Period check to only show progress bar when downloading files
setInterval(() => {
this.setState({
isDownloading: downloadHandler.getDownloads().filter(d => d.status !== 'finished')?.length > 0
})
console.log(downloadHandler.getDownloads())
}, 1000)
} }
render() { render() {
@@ -156,7 +165,9 @@ class App extends React.Component<IProps, IState> {
<div id="DownloadProgress" <div id="DownloadProgress"
onClick={() => this.setState({ miniDownloadsOpen: !this.state.miniDownloadsOpen })} onClick={() => this.setState({ miniDownloadsOpen: !this.state.miniDownloadsOpen })}
> >
{ this.state.isDownloading ?
<MainProgressBar downloadManager={downloadHandler} /> <MainProgressBar downloadManager={downloadHandler} />
: null }
</div> </div>
</div> </div>
</div> </div>