feat: complete text
This commit is contained in:
parent
e0dbd03397
commit
29b7366727
|
@ -19,6 +19,8 @@ const Download = (props: { onFinish: () => void }) => {
|
||||||
const [downloadProgress, setDownloadProgress] = useState<number>(0.0)
|
const [downloadProgress, setDownloadProgress] = useState<number>(0.0)
|
||||||
const [isDisabled, setIsDisabled] = useState(true)
|
const [isDisabled, setIsDisabled] = useState(true)
|
||||||
|
|
||||||
|
const [title, setTitle] = useState('Downloading')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Close().then(res => {
|
Close().then(res => {
|
||||||
StartDownload().then(res => {
|
StartDownload().then(res => {
|
||||||
|
@ -28,6 +30,7 @@ const Download = (props: { onFinish: () => void }) => {
|
||||||
setDownloadProgress(progress * 100)
|
setDownloadProgress(progress * 100)
|
||||||
if (progress === 1) {
|
if (progress === 1) {
|
||||||
props.onFinish()
|
props.onFinish()
|
||||||
|
setTitle('Completed')
|
||||||
setIsDisabled(false)
|
setIsDisabled(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -38,7 +41,7 @@ const Download = (props: { onFinish: () => void }) => {
|
||||||
<Dialog open={isOpen}>
|
<Dialog open={isOpen}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Downloading</DialogTitle>
|
<DialogTitle>{title}</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<Progress value={downloadProgress} />
|
<Progress value={downloadProgress} />
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
|
|
Loading…
Reference in New Issue