code refactoring
This commit is contained in:
@@ -2,5 +2,5 @@ import { atom } from 'recoil'
|
|||||||
|
|
||||||
export const loadingAtom = atom({
|
export const loadingAtom = atom({
|
||||||
key: 'loadingAtom',
|
key: 'loadingAtom',
|
||||||
default: false
|
default: true
|
||||||
})
|
})
|
||||||
@@ -14,7 +14,7 @@ const Downloads: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (active) {
|
if (active) {
|
||||||
setIsLoading(true)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
}, [active?.length])
|
}, [active?.length])
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const HomeActions: React.FC = () => {
|
|||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
}}
|
}}
|
||||||
onDownloadStart={(url) => {
|
onDownloadStart={(url) => {
|
||||||
pushMessage(`Requested ${url}`, 'info',)
|
pushMessage(`Requested ${url}`, 'info')
|
||||||
setOpenDialog(false)
|
setOpenDialog(false)
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const LoadingBackdrop: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<Backdrop
|
<Backdrop
|
||||||
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
|
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
|
||||||
open={!isLoading}
|
open={isLoading}
|
||||||
>
|
>
|
||||||
<CircularProgress color="primary" />
|
<CircularProgress color="primary" />
|
||||||
</Backdrop>
|
</Backdrop>
|
||||||
|
|||||||
Reference in New Issue
Block a user