From 92f51cc306f59fd74eb6eb2be0d006a15badd7fc Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 29 May 2022 22:04:17 -0700 Subject: [PATCH] do not show prog bar when not downloading --- src/ui/App.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 510a776..b12f3fe 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -83,6 +83,15 @@ class App extends React.Component { 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() { @@ -156,7 +165,9 @@ class App extends React.Component {
this.setState({ miniDownloadsOpen: !this.state.miniDownloadsOpen })} > - + { this.state.isDownloading ? + + : null }