mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import Tr from '../../../utils/language'
|
||||
import './ProgressBar.css'
|
||||
|
||||
interface IProps {
|
||||
@@ -67,9 +68,9 @@ export default class ProgressBar extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
|
||||
<div className="MainProgressText">
|
||||
Files Downloading: {this.state.files} ({this.state.speed})
|
||||
<Tr text="main.files_downloading" /> {this.state.files} ({this.state.speed})
|
||||
<br />
|
||||
Files Extracting: {this.state.extracting}
|
||||
<Tr text="main.files_extracting" /> {this.state.extracting}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ import { capitalize } from '../../../utils/string'
|
||||
import Stop from '../../../resources/icons/close.svg'
|
||||
import './ProgressBar.css'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import { translate } from '../../../utils/language'
|
||||
|
||||
interface IProps {
|
||||
path: string,
|
||||
@@ -31,11 +32,11 @@ export default class ProgressBar extends React.Component<IProps, IState> {
|
||||
|
||||
componentDidMount() {
|
||||
// Periodically check the progress of passed file path
|
||||
const intv = setInterval(() => {
|
||||
const intv = setInterval(async () => {
|
||||
const prog = this.props.downloadManager.getDownloadProgress(this.props.path)
|
||||
this.setState({
|
||||
progress: prog?.progress || 0,
|
||||
status: prog?.status || 'stopped',
|
||||
status: await translate(`download_status.${prog?.status || 'stopped'}`) || 'stopped',
|
||||
total: prog?.total || 0,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user